tejas-borate-wai/python-mcp-server
If you are the rightful owner of python-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
A simple Model Context Protocol (MCP) server implementation in Python.
MCP Server
A powerful Model Context Protocol (MCP) server AND REST API in Python that provides:
- 🗄️ SQL Server database operations
- 🌤️ Weather information
- 📁 File operations
- 🌐 Web requests
- 💻 System information
- ➕ Utility tools
🚀 Two Ways to Use
1️⃣ MCP Protocol (For Claude Desktop & MCP-compatible LLMs)
Traditional MCP server for direct integration with Claude Desktop
2️⃣ REST API (For Any LLM or Application)
FastAPI REST server that exposes all MCP tools as HTTP endpoints Perfect for LLMs that don't support MCP protocol (ChatGPT, Gemini, etc.)
Installation
This project uses uv for package management. If you haven't installed uv yet:
irm https://astral.sh/uv/install.ps1 | iex
Then add it to your PATH:
$env:Path = "C:\Users\$env:USERNAME\.local\bin;$env:Path"
Setup
Install dependencies:
uv sync
Running the Server
Option 1: MCP Server (for Claude Desktop)
Run the MCP server:
uv run mcp-server
Option 2: REST API Server (for any LLM)
Run the FastAPI REST API server:
uv run mcp-api
Server will start at: http://localhost:8000
- 📚 Interactive API docs: http://localhost:8000/docs
- 📊 Alternative docs: http://localhost:8000/redoc
See for complete API documentation and examples.
Or activate the virtual environment and run directly:
.venv\Scripts\activate
python -m mcp_server
Available Tools
MCP Server Tools:
- echo - Echoes back the input message
- add - Adds two numbers together
- read_file - Reads content from a local file
- write_file - Writes content to a local file
- system_info - Returns system/OS/hardware information
- web_request - Makes HTTP GET requests to URLs
- get_weather - Gets current weather for any city
- sql_query - Executes SELECT queries on SQL Server database
- list_tables - Lists all tables in the database
- describe_table - Shows table structure (columns, types, etc.)
REST API Endpoints:
All MCP tools are also available as HTTP endpoints:
POST /echo- Echo messagesPOST /add- Add numbersPOST /read-file- Read filesPOST /write-file- Write filesGET /system-info- System informationPOST /web-request- HTTP requestsPOST /weather- Weather dataPOST /sql/query- SQL queriesGET /sql/tables- List tablesPOST /sql/describe- Table structure
See for detailed API documentation.
Project Structure
python-mcp-server/
├── src/
│ └── mcp_server/
│ └── __init__.py # Main server implementation
├── pyproject.toml # Project configuration
├── uv.lock # Dependency lock file
└── README.md # This file
Connecting to Claude Desktop
To use this MCP server with Claude Desktop:
-
Locate your Claude config file at:
C:\Users\<YourUsername>\AppData\Roaming\Claude\claude_desktop_config.json -
Add this server configuration:
{ "mcpServers": { "python-mcp-server": { "command": "C:\\Users\\TejasBorate\\.local\\bin\\uv.exe", "args": [ "--directory", "C:\\Users\\TejasBorate\\Desktop\\python-mcp-server", "run", "mcp-server" ] } } }Note: Use the full path to
uv.exeso Claude Desktop can find it. -
Restart Claude Desktop completely (quit and reopen)
-
Verify connection: In Claude Desktop, you should see a 🔨 (hammer) icon indicating MCP tools are available. Click it to see your
echoandaddtools.
Quick Setup Script
Run this in PowerShell to automatically configure Claude Desktop:
$config = @{
mcpServers = @{
"python-mcp-server" = @{
command = "C:\Users\TejasBorate\.local\bin\uv.exe"
args = @(
"--directory"
"C:\Users\TejasBorate\Desktop\python-mcp-server"
"run"
"mcp-server"
)
}
}
}
$config | ConvertTo-Json -Depth 10 | Out-File -FilePath "$env:APPDATA\Claude\claude_desktop_config.json" -Encoding ASCII
Write-Host "✅ Configuration updated! Please restart Claude Desktop."
Development
To add new tools, edit src/mcp_server/__init__.py and:
- Add the tool definition in
list_tools() - Add the tool handler in
call_tool() - Restart Claude Desktop to reload the server