Model Context Protocol
BlueLens MCP exposes your CodeGraph β nodes, dependencies, blast-radius analysis, and architectural rules β directly to Claude, Cursor, and any MCP-compatible agent.
Architecture
BlueLens MCP runs either locally alongside your editor (zero setup, your data never leaves your machine) or as a hosted cloud endpoint your agents can reach from anywhere.
The @bluelens/mcp package runs as a stdio process on your machine. It reads your local CodeGraph directly from disk. No account required. Works with any MCP client.
A hosted Streamable HTTP endpoint at mcp.bluelens.dev/api/mcp. Push your CodeGraph once with push_to_cloud, then any agent anywhere can query it with just a Bearer token.
Installation
No account needed. Runs on your machine, reads your local CodeGraph.
npm install -g @bluelens/mcpPoint your client at the bluelens-mcp binary. See Configure for client-specific examples.
In the BlueLens editor (app.bluelens.dev), open your project and run a CodeGraph scan. The graph is stored locally; the MCP server reads it on demand.
Your agents connect via HTTP from anywhere β no local process needed on the agent side.
npm install -g @bluelens/mcpAny secret string works as your API key β it namespaces your data on the server. Generate one with:
openssl rand -hex 32In any MCP-enabled session with your local server, call:
push_to_cloud(
graph_id: "<your-graph-id>",
cloud_url: "https://mcp.bluelens.dev",
api_key: "<your-secret-key>"
)Configure the cloud server as an HTTP MCP server. See Configure below.
Configuration
{
"mcpServers": {
"bluelens": {
"command": "bluelens-mcp",
"args": []
}
}
}{
"mcpServers": {
"bluelens-cloud": {
"type": "http",
"url": "https://mcp.bluelens.dev/api/mcp",
"headers": {
"Authorization": "Bearer <your-api-key>"
}
}
}
}{
"mcpServers": {
"bluelens": {
"command": "bluelens-mcp",
"args": []
}
}
}{
"mcpServers": {
"bluelens-cloud": {
"url": "https://mcp.bluelens.dev/api/mcp",
"headers": {
"Authorization": "Bearer <your-api-key>"
}
}
}
}# Test connectivity
curl https://mcp.bluelens.dev/api/mcp \
-H "Authorization: Bearer <your-api-key>" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"tools/list","id":1}'API key security: your key is hashed with SHA-256 before being used as a storage namespace. The raw key is never stored. Any secret string of 16+ characters works.
Reference
All tools are available in both the local and cloud server unless otherwise noted.
Analysis
CodeGraph
Workspaces & Diagrams
Local-only tools
graph_id, cloud_url, and api_key.Usage
Once connected, your agent can reason about your codebase's structure without reading every file.
βWhat is the blast radius of changing utils/auth.ts?β
Agent calls find_nodes to locate the module, then analyze_node_impact for transitive dependents.
βDo any modules in the 'api' domain import from 'ui'?β
Agent calls check_architectural_rules with a forbidden_cross_domain rule.
βWhat changed structurally between last week's graph and today's?β
Agent calls diff_codegraphs on two snapshots to surface added/removed modules and new dependencies.
βHow is PaymentService coupled to the rest of the system?β
Agent calls find_nodes, then analyze_node_impact to show fan-in, fan-out, and risk score.
βFind the shortest path between UserController and DatabasePool.β
Agent calls find_dependency_path β reveals indirect coupling chains.
REST API
In addition to the MCP protocol endpoint, the cloud server exposes a REST endpoint for pushing CodeGraphs programmatically.
# Headers
Authorization: Bearer <your-api-key>
Content-Type: application/json
# Body β CodeGraph JSON (exported from BlueLens editor)
{
"id": "graph_abc123",
"name": "my-service",
"nodes": { ... },
"relations": { ... }
}
# Response
{
"success": true,
"graphId": "graph_abc123",
"nodeCount": 412
}Workspace auto-creation: if the graph's workspaceId doesn't exist in your account, a βDefaultβ workspace is created automatically. No pre-setup needed.