This system is a modular, hybrid MCP (Model Context Protocol) server that can spawn and manage satellite MCP servers. Each server can be customized with tools, API keys, and access control. The system is designed for extensibility, agent collaboration, and remote integration (e.g., with VS Code extensions).
- Unified API:
/chat,/remote,/tools,/spawn_satellite,/satellites,/satellite/{port} - Agent Management: Dynamically loads agents from
backend/agents/. - Global Tools: Built-in tools like
echo,math,upper,lower,date,random. - OpenAI-Compatible API Key Management: Set and get keys for core and satellites.
- Remote Access: Secure
/remoteendpoint for non-API-key clients (e.g., VS Code extensions). - Access Control: Shared secret and rate limiting for
/remote.
- Customizable: Spawn with selected tools and API keys.
- Remote Endpoint:
/remotefor tool access, no API key required (unless you add it). - Config Endpoint:
/configreturns current tool and key settings.
uvicorn main:app --reload --host 0.0.0.0 --port 8050curl http://127.0.0.1:8050/toolscurl -X POST http://127.0.0.1:8050/chat -H 'Content-Type: application/json' -d '{"agent": "echo", "message": "Hello!"}'
# or
curl -X POST http://127.0.0.1:8050/chat -H 'Content-Type: application/json' -d '{"tool": "math", "message": "2+2"}'curl -X POST http://127.0.0.1:8050/remote -H 'Content-Type: application/json' -d '{"secret": "changeme", "tool": "echo", "message": "Hello from VS Code!"}'- Set the
REMOTE_SECRETenvironment variable to change the shared secret.
curl -X POST http://127.0.0.1:8050/spawn_satellite -H 'Content-Type: application/json' -d '{"tools": ["echo", "math"], "api_keys": {"openai": "sk-..."}, "openai_key": "sk-...", "port": 9001}'- The satellite will run on the specified port (default: 9000+N).
curl -X POST http://127.0.0.1:9001/remote -H 'Content-Type: application/json' -d '{"tool": "echo", "message": "Hi from satellite!"}'- See
/configon the satellite for its current settings.
- List:
GET /satellites - Get config:
GET /satellite/{port} - Stop:
POST /satellite/{port}/stop - Update:
POST /satellite/{port}/update(with new tools, keys, etc.)
- All agents must implement a
respond(message, config)function. - Agents can communicate via the core server by sending messages to
/chatwith the target agent name.
- Change the
REMOTE_SECRETfor production. - Use rate limiting and logging to monitor remote access.
- Only expose necessary endpoints to the public.
- Review and update agent code to follow the
respondinterface.
- Add new tools by defining a function and adding it to
GLOBAL_TOOLS(core) orTOOL_FUNCS(satellite). - Add new agents by placing them in
backend/agents/with arespondfunction and aconfig.json. - Customize satellite servers by editing
backend/satellite_template.py.
- If you see errors, check the logs and ensure all imports and definitions are in the correct order.
- Use the
/toolsendpoint to verify available tools. - Use
/configon satellites to verify their setup.
For questions or contributions, see the project README or contact the maintainer.