This project helps you create and manage a local MCP (Model Context Protocol) server using Composio's 500+ integrations.
- Composio API Key: Get yours from Composio Platform
- Auth Configurations: Create auth configs for your toolkits in the Composio Dashboard
- Python 3.8+: Make sure Python is installed
pip install -r requirements.txtCopy the example environment file and fill in your credentials:
cp .env.example .envEdit .env and add:
- Your
COMPOSIO_API_KEY - Your auth config IDs (replace the placeholder IDs in
mcp_server.py) - Optional: API keys for OpenAI/Anthropic if using examples
Before running the server, you need to create auth configurations for your toolkits:
- Go to Composio Dashboard → Auth Configs
- Create auth configs for each toolkit you want to use (e.g., Gmail, Google Calendar)
- Copy the auth config IDs (format:
ac_xyz123) - Update
mcp_server.pywith your actual auth config IDs
Run the main script to create your MCP server:
python mcp_server.pyThis will:
- Create an MCP server with your configured toolkits
- Generate a unique URL for your user
- Display the MCP server URL to use with AI providers
Important: Users must authenticate with the toolkits before the MCP server can use them.
See Hosted Authentication for how to connect user accounts.
# Set your MCP server URL in .env as MCP_SERVER_URL
python openai_example.py# Set your MCP server URL in .env as MCP_SERVER_URL
python anthropic_example.py.
├── mcp_server.py # Main script to create and manage MCP server
├── openai_example.py # Example usage with OpenAI
├── anthropic_example.py # Example usage with Anthropic
├── requirements.txt # Python dependencies
├── .env.example # Environment variables template
└── README.md # This file
Edit mcp_server.py to add or modify toolkits:
toolkits=[
{
"toolkit": "gmail",
"auth_config": "ac_xyz123" # Your auth config ID
},
{
"toolkit": "googlecalendar",
"auth_config": "ac_abc456" # Your auth config ID
}
]Modify the allowed_tools list in mcp_server.py:
allowed_tools=[
"GMAIL_FETCH_EMAILS",
"GMAIL_SEND_EMAIL",
"GOOGLECALENDAR_EVENTS_LIST"
]Composio supports 500+ integrations. Check the Composio Docs for the full list of available toolkits and their tools.
- Make sure you've created a
.envfile with your API key
- Verify your auth config IDs are correct
- Make sure auth configs are created in the Composio dashboard
- Ensure users have authenticated with the toolkits
- Check that the user_id matches the authenticated user
┌──────────────┐ WebSocket ┌──────────────────────┐
│ Frontend │ <------------------> │ FastAPI │
│ React + D3 │ │ Memory + Graph API │
└──────────────┘ └─────────┬────────────┘
Faiss/Sbert │ Neo4j Bolt
│
┌──────┴─────┐
│ Storage │
└────────────┘
- backend/ – FastAPI, Sentence-Transformers + FAISS for semantic memory, Whisper for audio, Neo4j for entity graph, ComposioClient wrapper.
- frontend/ – React + Tailwind + D3, real-time graph via
/ws. - docker-compose orchestrates Neo4j, backend, frontend.
# build & start everything
docker compose up --build
# dashboard
http://localhost:5173 # React UI
http://localhost:7474 # Neo4j Browser
http://localhost:8000/docs # FastAPI docsEnvironment variables can be placed in .env (loaded by backend):
COMPOSIO_API_KEY=...
NEO4J_URI=bolt://neo4j:7687
NEO4J_USER=neo4j
NEO4J_PASSWORD=password
| Route | Method | Body | Description |
|---|---|---|---|
/ingest/text |
POST | {text, metadata?} |
Embed text & update graph |
/ingest/audio |
POST (multipart) | file | Transcribe & ingest audio |
/recall |
POST | {query, top_k} |
Semantic search over memories |
/graph |
GET | – | Current memory→entity mapping |
/ws |
WS | – | Pushes graph JSON every 5 s |
Interactive OpenAPI docs served at /docs.
The React app auto-connects to ws://localhost:8000/ws and renders the graph. It expects memories and entities; circles are colour-coded.
Development outside Docker:
cd frontend
npm i
npm run dev- Tests – add pytest modules under
tests/. - Lint – frontend uses TypeScript strict mode; backend should follow
ruff/black(not enforced here).
- Composio MCP servers only support Streamable HTTP transport
- MCP server URLs are unique per user
- Tools requiring authentication won't work until users connect their accounts