An Model Context Protocol (MCP) server in Python that supports multiple clients and concurrent agents, using the official python-sdk.
Repository: github.com/sripadlokapure-moodys/MADatabricks-DataSharing
- Python 3.10+
- MCP SDK 1.2.0+
git clone https://github.com/sripadlokapure-moodys/MADatabricks-DataSharing.git
cd MADatabricks-DataSharingpython -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txtFrom the project folder, with Git installed and GitHub auth set up:
.\setup-git.ps1Or manually:
git init
git remote add origin https://github.com/sripadlokapure-moodys/MADatabricks-DataSharing.git
git add .
git commit -m "Initial commit: sripad-mcp-server"
git branch -M main
git push -u origin mainMCP hosts typically start the server as a subprocess. Default is stdio (one client per process):
python server.py
# or explicitly:
python server.py --transport stdioThe server speaks JSON-RPC over stdin/stdout. Let your MCP host start it; don’t keep it running manually for long.
To allow multiple clients to connect to one server and multiple agents to call tools at the same time, run with the streamable HTTP transport:
python server.py --transport streamable-http [--host 127.0.0.1] [--port 8000] [--path /mcp]- Multiple clients: Many Cursor windows, Claude Desktop instances, or other MCP clients can connect to
http://<host>:<port><path>(e.g.http://127.0.0.1:8000/mcp). - Concurrent agents: Tools are implemented as
asyncso the server can handle many requests concurrently without blocking.
Example:
python server.py --transport streamable-http --port 8000Then point clients to http://127.0.0.1:8000/mcp. You can test with MCP Inspector: npx -y @modelcontextprotocol/inspector and connect to that URL.
In Cursor settings, open MCP and add a server. Example config (edit paths as needed):
{
"mcpServers": {
"sripad-mcp-server": {
"command": "python",
"args": ["C:\\Users\\lokapurs\\python-mcp-server\\server.py"],
"cwd": "C:\\Users\\lokapurs\\python-mcp-server",
"env": {}
}
}
}If you use a virtualenv, use the venv Python:
"command": "C:\\Users\\lokapurs\\python-mcp-server\\.venv\\Scripts\\python.exe"| Type | Name / URI | Description |
|---|---|---|
| Tool | add |
Add two integers. |
| Tool | greet |
Return a greeting for a name. |
| Tool | echo |
Echo a message (for testing). |
| Resource | greeting://{name} |
Read a greeting for name. |
| Prompt | summarize_prompt |
Prompt template to summarize a topic. |
- Tools: Use
async defand@mcp.tool()for concurrency; add type hints and docstrings so the SDK can describe them. - Resources: Add functions decorated with
@mcp.resource("uri://pattern")that return string content. - Prompts: Add functions decorated with
@mcp.prompt()that return prompt text (e.g. with placeholders).
For stdio transport, avoid writing to stdout (e.g. use print(..., file=sys.stderr) or logging to stderr) so JSON-RPC messages are not corrupted.