Internal MCP server for the Sanctum Suite (built around the Letta Agentic AI framework).
Version: 2.2.0
A powerful, modular orchestration server designed to securely expose and manage command-line tools and automation scripts within your internal infrastructure. Built for the Letta Agentic AI framework, MCP operates as a Server-Sent Events (SSE) server using aiohttp for real-time communication and is now fully compliant with the Model Context Protocol (MCP).
mcp/plugins/
at startup. No static registrationβjust drop in a new plugin with a cli.py
and it will be available after a server restart.The project includes a comprehensive testing infrastructure:
bash
Run all tests
python run_tests.py --type allRun specific test types
python run_tests.py --type unit # Unit tests
python run_tests.py --type integration # Integration tests
python run_tests.py --type e2e # End-to-end testsRun with coverage
python run_tests.py --type all --coverageRun individual test files
python -m pytest tests/unit/
python -m pytest tests/integration/
python -m pytest tests/e2e/
Test Coverage:
1. Clone the repository and install dependencies:
bash
git clone https://github.com/actuallyrizzn/sanctum-letta-mcp.git
cd sanctum-letta-mcp
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
2. Run the MCP SSE server:
bash
python -m mcp.mcp_server
or (if running as a service):
bash
python mcp/mcp_server.py
3. Run tests to verify everything works:
bash
python run_tests.py --type all
HTTP Request:
http
POST /message HTTP/1.1
Content-Type: application/json{
"jsonrpc": "2.0",
"id": "req-1",
"method": "tools/call",
"params": {
"name": "botfather.click-button",
"arguments": {"button-text": "Payments", "msg-id": 12345678}
}
}
SSE Response Stream (on connect):
data: {"jsonrpc":"2.0","method":"notifications/tools/list","params":{"tools":[...]}}
Tool Call Response:
json
{
"jsonrpc": "2.0",
"id": "req-1",
"result": {
"content": [
{"type": "text", "text": "Clicked button Payments on message 12345678"}
]
}
}
GET /sse
- SSE connection for real-time events (emits tools manifest on connect)POST /message
- Tool invocation endpoint (JSON-RPC 2.0)GET /health
- Health check with plugin and session counts
letta-internal-mcp/
βββ mcp/ # Main package
β βββ mcp_server.py # aiohttp SSE server entrypoint
β βββ plugins/ # Plugin implementations (auto-discovered)
β β βββ botfather/ # BotFather automation plugin
β β βββ devops/ # DevOps automation plugin
β βββ __init__.py # Package metadata
βββ tests/ # Comprehensive test suite
β βββ unit/ # Unit tests for core functions
β βββ integration/ # HTTP/SSE integration tests
β βββ e2e/ # End-to-end workflow tests
β βββ conftest.py # Test fixtures and configuration
βββ docs/ # Documentation
βββ run_tests.py # Test runner with coverage
βββ requirements.txt # Dependencies
βββ pytest.ini # Pytest configuration
Environment Variables:
MCP_PORT
- Server port (default: 8000)MCP_HOST
- Server host (default: 0.0.0.0)MCP_PLUGINS_DIR
- Custom plugins directory (default: mcp/plugins/)Core:
aiohttp==3.9.1
- Async HTTP serveraiohttp-cors==0.7.0
- CORS supportpydantic==2.6.1
- Data validationTesting:
pytest==7.4.3
- Testing frameworkpytest-asyncio==0.21.1
- Async test supportpytest-cov==4.1.0
- Coverage reportingpytest-mock==3.12.0
- Mocking utilitiespytest-timeout==2.1.0
- Test timeout protectionThis project is licensed under the Creative Commons Attribution-ShareAlike (CC BY-SA) license. See LICENSE for details.
---
Note: