https://github.com/abhimvp/CustomMCPServer
  
  
    build a custom MCP server in Python  and connect that to an AI agent.  
    https://github.com/abhimvp/CustomMCPServer
  
        Last synced: about 2 months ago 
        JSON representation
    
build a custom MCP server in Python and connect that to an AI agent.
- Host: GitHub
 - URL: https://github.com/abhimvp/CustomMCPServer
 - Owner: abhimvp
 - Created: 2025-04-16T14:38:09.000Z (7 months ago)
 - Default Branch: main
 - Last Pushed: 2025-04-16T16:20:51.000Z (7 months ago)
 - Last Synced: 2025-04-17T00:21:03.479Z (7 months ago)
 - Language: Python
 - Size: 338 KB
 - Stars: 0
 - Watchers: 1
 - Forks: 0
 - Open Issues: 0
 - 
            Metadata Files:
            
- Readme: README.md
 
 
Awesome Lists containing this project
- awesome-mcp-servers - **CustomMCPServer** - build a custom MCP server in Python and connect that to an AI agent. `python` `mcp` `server` `ai` `pip install git+https://github.com/abhimvp/CustomMCPServer` (🤖 AI/ML)
 - awesome-mcp-servers - **CustomMCPServer** - build a custom MCP server in Python and connect that to an AI agent. `python` `mcp` `server` `ai` `pip install git+https://github.com/abhimvp/CustomMCPServer` (AI/ML)
 
README
          # CustomMCPServer
Build a custom MCP server in Python and connect that to an AI agent.
- Resources:
  - [Python MCP Server SDK](https://github.com/modelcontextprotocol/python-sdk?tab=readme-ov-file)
  - [Reference Code](https://github.com/techwithtim/PythonMCPServer)
- MCP servers are essentially how LLM and AI Tools communicate with each other.The Model Context Protocol allows applications to provide context for LLMs in a standardized way, separating the concerns of providing context from the actual LLM interaction.
```bash
# create a uv-managed project
$ uv init .
Initialized project `custommcpserver` at `C:\Users\abhis\Desktop\AIAgents\CustomMCPServer`
# Then add MCP to your project dependencies:
$ uv add "mcp[cli]"
# activate python environment as well
$ source .venv/scripts/activate
# You can install this server in Claude Desktop and interact with it right away by running:
# mcp install main.py
# since we're in this vs code we do
$ uv run mcp install main.py
[04/16/25 10:06:31] INFO     Added server 'Demo' to Claude config
                    INFO     Successfully installed Demo in Claude app
# go to claude app > File > settings > Developer > Edit Config - opens up some file and open that claude_desktop_config.json file
# we can see the mcp run main.py(path) is added in that file.
# the mcp server should show up on claude app - if it's not - we do the following
# close claude app - open task manager and search fo claude and right click & do end task.
# wait a sec & open the app again
#  once the app loads , it spins up the mcp server and it shows on app - refer the image below & when you click on tool we can see the
# add tool and server:DEMO
```



## Advanced MCP Server
- before we go ahead , **fundamentally What is MCP?**:
  - lets you build **servers** that _expose data_ and functionality to LLM applications in a secure, standardized way. Think of it like a web API, but specifically designed for LLM interactions.
    - Expose data through **Resources** (think of these sort of like GET endpoints; they are used to load information into the LLM's context)
    - Provide functionality through **Tools** (sort of like POST endpoints; they are used to execute code or otherwise produce a side effect)
    - Define interaction patterns through **Prompts** (reusable templates for LLM interactions)
    - And more!
```bash
uv add black
# after creating new mcp server & tool
$ uv run mcp install adv_main.py
[04/16/25 10:44:02] INFO     Added server 'AI Sticky Notes' to Claude config
                    INFO     Successfully installed AI Sticky Notes in Claude app
```






- from this above example , we can see how to make use of tool we create and do whatever we can like.
- add a tool to connect to db and ask claude to create 100 fake users into db , instead of us manually copy paste ..etc.we can automate lot of stuff.