Agents & MCP
Connect your AI agents to Lampion via the MCP (Model Context Protocol) protocol. 47 tools and 5 resources to manage PostgreSQL directly from Claude, Cursor, Windsurf, or any compatible MCP client.
Install
The Lampion MCP server is open source on GitHub and distributed on PyPI under the name lampion-mcp. A single command is all it takes.
$ pip install lampion-mcp$ uv pip install lampion-mcpRequirements — Python 3.10+. The package automatically installs mcp[cli] and httpx as dependencies.
Configure
Generate an API key in Settings > API Keys in the console, then configure your MCP client.
{
"mcpServers": {
"lampion": {
"command": "lampion-mcp",
"env": {
"LAMPION_TOKEN": "lmp_live_xxx..."
}
}
}
}{
"servers": {
"lampion": {
"command": "lampion-mcp",
"env": {
"LAMPION_TOKEN": "lmp_live_xxx..."
}
}
}
}# Via argument $ lampion-mcp --token lmp_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # Via environment variable $ export LAMPION_TOKEN=lmp_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx $ lampion-mcp
Use
Once configured, your AI agent can interact with Lampion in natural language. The MCP server translates intent into API calls.
31 available tools
Each tool maps to a Lampion REST API endpoint. The agent automatically picks the right tool based on your request.
MCP resources
Resources are read-only endpoints, accessible by URI. The agent can read them to get context without performing an action.
Workflow examples
A few complete scenarios showing how an agent chains tools together.
Deploy a feature branch
1. create_branch(project_id, "feat-auth", "main") 2. execute_sql(... "CREATE TABLE sessions (...)") 3. execute_sql(... "INSERT INTO sessions ...") 4. get_schema(... "postgres", "public") // Check the schema 5. get_metrics(...) // Check performance 6. delete_branch(... "feat-auth") // Cleanup
Full performance audit
1. get_metrics(...) // Overview 2. get_slow_queries(... limit=20) // Top slow queries 3. execute_sql(... "EXPLAIN ANALYZE ...") // Execution plan 4. get_logs(... lines=50) // Recent logs 5. get_project_usage(...) // Associated costs → The agent synthesizes: index recommendations, alerts, estimates
Safe migration
1. create_backup(... "pre-migration") // Snapshot 2. create_branch(... "migration-test") // Test branch 3. execute_sql(... "ALTER TABLE ...") // Test the migration 4. get_schema(...) // Check the result 5. execute_sql(on main, "ALTER TABLE ...") // Apply to production 6. delete_branch(... "migration-test") // Cleanup