custodyops-mcp-python
custodyops-mcp-python
Ein minimaler Python MCP-Server über Streamable HTTP mit FastAPI + fastmcp, bereit zur Bereitstellung auf Render mit HTTPS. Er stellt ein ping-Tool sowie zwei Demo-Tools (get_positions, list_upcoming_corporate_actions) bereit, die Sie durch schreibgeschützte Adapter für Ihre Verwahrungsdaten ersetzen können.
Warum Streamable HTTP? Es ist der empfohlene Transport für Remote/gehostete MCP-Server, vereinfacht bidirektionales Streaming zu einem einzigen
POST /mcp-Endpunkt und macht die Cloud-Bereitstellung unkompliziert. Siehe den MCP-HTTP-Schnellstart und die SDK-Dokumentation für die kanonischen Muster.
Features
Streamable HTTP-Endpunkt unter
POST /mcpBearer-Authentifizierung über
AUTH_TOKEN/health-Endpunkt für VerfügbarkeitsprüfungenMinimaler Code-Footprint, leicht erweiterbar mit weiteren MCP-Tools
Ein-Klick-Bereitstellung auf Render über
render.yaml
Related MCP server: MCP Ping-Pong Server
Quick start (local)
python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scriptsctivate
pip install -r requirements.txt
export AUTH_TOKEN=devtoken123
export PORT=3000
uvicorn app:app --host 0.0.0.0 --port $PORTTest mit cURL:
# tools/list
curl -s -X POST http://localhost:3000/mcp -H "Content-Type: application/json" -H "Authorization: Bearer devtoken123" -d '{"jsonrpc":"2.0","id":"1","method":"tools/list","params":{}}' | jq
# tools/call ping
curl -s -X POST http://localhost:3000/mcp -H "Content-Type: application/json" -H "Authorization: Bearer devtoken123" -d '{"jsonrpc":"2.0","id":"2","method":"tools/call","params":{"name":"ping","arguments":{}}}' | jqOder Hilfsskript ausführen:
chmod +x scripts/test_locally.sh
AUTH_TOKEN=devtoken123 PORT=3000 ./scripts/test_locally.shDeploy to Render (HTTPS)
Forken oder pushen Sie dieses Repository auf Ihr GitHub.
In Render: Neu → Webdienst → Repository verbinden.
Überprüfen Sie die Einstellungen aus
render.yaml(Python-Umgebung, kostenloser Plan). Render stellt automatisch HTTPS bereit.Setzen Sie
AUTH_TOKENin der Render-Umgebung (wird automatisch generiert, wenn Sie die Blaupause verwenden).Bereitstellen → Ihr öffentlicher MCP-Endpunkt ist:
https://<your-app>.onrender.com/mcp.
Remote testen:
APP_URL=https://<your-app>.onrender.com AUTH_TOKEN=<token> ./scripts/test_remote.shUsing from Claude Desktop (remote MCP)
Fügen Sie einen Relais-Eintrag zu claude_desktop_config.json hinzu:
{
"mcpServers": {
"custodyops-mcp": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://<your-app>.onrender.com/mcp"],
"env": { "AUTH_TOKEN": "<same-token>" }
}
}
}Starten Sie die App neu, und bitten Sie dann Claude, die verfügbaren Tools aufzulisten.
Extend with real custody data
Ersetzen Sie die Demo-Tools durch schreibgeschützte Adapter für Ihren Data Mart oder Ihre API. Halten Sie Antworten klein und typisiert, und fügen Sie nach Möglichkeit Feldherkunft hinzu.
Beispiel-Skelett:
@mcp_tool
def get_positions(account_id: str) -> str:
rows = query_positions(account_id) # your adapter
return json.dumps(rows)Security notes
Halten Sie
AUTH_TOKENgeheim; rotieren Sie regelmäßig. Für den Unternehmenseinsatz wechseln Sie zu OAuth/JWT und fügen Sie eine pro-Konto-Autorisierung hinzu.Bei HTTP-Transport ist normales Logging in Ordnung, aber schwärzen Sie sensible Daten und fügen Sie Anforderungs-IDs hinzu.
License
MIT
Related MCP Connectors
MCP server for Modern Treasury — payment orders, transactions, counterparties and ledgers.
Multi-tenant FastMCP server for Charles Schwab brokerage data, monetized via DPYC Tollbooth
MCP server for Codat — companies, connections, invoices, bills and financial statements.
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA minimal Model Context Protocol server built with FastAPI that provides a basic "Hello World" resource and tool. Serves as a starting point for building and validating MCP client integrations with richer resources and tools.-
- AlicenseNot gradedqualityDmaintenanceAn experimental MCP server demonstrating remote calls via FastAPI, supporting ping-pong commands through API endpoints and SSE transport.2MIT
- FlicenseNot gradedqualityDmaintenanceEnables building and running MCP servers over streamable HTTP, exposing tools to AI assistants like Cursor, with examples of mounting multiple servers in FastAPI.-
- FlicenseNot gradedqualityDmaintenanceA Python-based MCP server that exposes tools over streamable HTTP using FastAPI, enabling connection to AI assistants like Cursor. Supports multiple servers mounted in a single FastAPI app.-