bluelens-mcp 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +182 -0
- package/dist/index.js +3875 -0
- package/package.json +28 -0
package/README.md
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
# bluelens-mcp
|
|
2
|
+
|
|
3
|
+
Model Context Protocol server for [BlueLens](https://bluelens.dev) — gives AI agents structural awareness of your codebase via a semantic graph.
|
|
4
|
+
|
|
5
|
+
## What it does
|
|
6
|
+
|
|
7
|
+
BlueLens MCP connects Claude, Cursor, and any MCP-compatible AI agent to your local BlueLens data: diagrams, workspaces, and CodeGraphs. Instead of reading raw files, your agent can navigate your codebase as a typed graph — querying nodes, tracing dependencies, running blast-radius analysis, and enforcing architectural rules.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install -g bluelens-mcp
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Requires **Node.js >= 20**.
|
|
16
|
+
|
|
17
|
+
## Setup
|
|
18
|
+
|
|
19
|
+
### Claude Code / Claude Desktop
|
|
20
|
+
|
|
21
|
+
Add to `~/.claude/claude_desktop_config.json`:
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"mcpServers": {
|
|
26
|
+
"bluelens": {
|
|
27
|
+
"command": "bluelens-mcp",
|
|
28
|
+
"args": []
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Cursor
|
|
35
|
+
|
|
36
|
+
Add to `~/.cursor/mcp.json`:
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"mcpServers": {
|
|
41
|
+
"bluelens": {
|
|
42
|
+
"command": "bluelens-mcp",
|
|
43
|
+
"args": []
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Any MCP client (stdio)
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"command": "bluelens-mcp",
|
|
54
|
+
"args": []
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Data is read from `~/.bluelens/` by default. Override with the `BLUELENS_DATA_DIR` environment variable.
|
|
59
|
+
|
|
60
|
+
## Available tools
|
|
61
|
+
|
|
62
|
+
### CodeGraph analysis
|
|
63
|
+
|
|
64
|
+
| Tool | Description |
|
|
65
|
+
|---|---|
|
|
66
|
+
| `list_codegraphs` | List all stored CodeGraphs |
|
|
67
|
+
| `get_codegraph_summary` | High-level summary: node counts, domains, dependency stats |
|
|
68
|
+
| `get_codegraph_nodes` | Browse nodes filtered by depth, kind, or parent |
|
|
69
|
+
| `detect_codegraph_anomalies` | Find circular deps, orphans, god nodes, broken references |
|
|
70
|
+
| `scan_codebase` | Scan a local directory and generate a CodeGraph |
|
|
71
|
+
| `delete_codegraph` | Delete a stored CodeGraph |
|
|
72
|
+
|
|
73
|
+
### Impact analysis
|
|
74
|
+
|
|
75
|
+
| Tool | Description |
|
|
76
|
+
|---|---|
|
|
77
|
+
| `find_nodes` | Search nodes by name, file path, kind, or depth |
|
|
78
|
+
| `analyze_node_impact` | Blast-radius analysis: direct dependents, transitive impact, risk score |
|
|
79
|
+
| `find_dependency_path` | Shortest dependency path between two nodes |
|
|
80
|
+
| `diff_codegraphs` | Structural diff between two CodeGraph snapshots |
|
|
81
|
+
| `check_architectural_rules` | Enforce forbidden imports and fan-in thresholds |
|
|
82
|
+
| `review_architectural_drift` | Summary of structural drift over time |
|
|
83
|
+
|
|
84
|
+
### Diagrams
|
|
85
|
+
|
|
86
|
+
| Tool | Description |
|
|
87
|
+
|---|---|
|
|
88
|
+
| `list_diagrams` | List diagrams, optionally filtered by workspace or folder |
|
|
89
|
+
| `get_diagram` | Get a diagram's full content |
|
|
90
|
+
| `create_diagram` | Create a new diagram |
|
|
91
|
+
| `update_diagram` | Update an existing diagram |
|
|
92
|
+
| `delete_diagram` | Delete a diagram |
|
|
93
|
+
| `search_diagrams` | Full-text search across diagram titles and content |
|
|
94
|
+
| `generate_domain_diagrams` | Auto-generate diagrams from a CodeGraph |
|
|
95
|
+
| `add_node_link` | Add a link between nodes in a diagram |
|
|
96
|
+
| `remove_node_link` | Remove a link between nodes |
|
|
97
|
+
| `export_for_bluelens` | Export diagram data for use in the BlueLens editor |
|
|
98
|
+
|
|
99
|
+
### Workspaces
|
|
100
|
+
|
|
101
|
+
| Tool | Description |
|
|
102
|
+
|---|---|
|
|
103
|
+
| `list_workspaces` | List all workspaces |
|
|
104
|
+
| `create_workspace` | Create a new workspace |
|
|
105
|
+
| `delete_workspace` | Delete a workspace and all its contents |
|
|
106
|
+
| `list_folders` | List folders within a workspace |
|
|
107
|
+
| `create_folder` | Create a folder |
|
|
108
|
+
| `delete_folder` | Delete a folder |
|
|
109
|
+
|
|
110
|
+
### Cloud sync
|
|
111
|
+
|
|
112
|
+
| Tool | Description |
|
|
113
|
+
|---|---|
|
|
114
|
+
| `push_to_cloud` | Upload a CodeGraph to the BlueLens Cloud MCP server |
|
|
115
|
+
|
|
116
|
+
## Cloud mode
|
|
117
|
+
|
|
118
|
+
For teams or multi-machine setups, push your CodeGraph to the cloud once and let any agent query it via HTTP — no local process needed on the agent side.
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
push_to_cloud(
|
|
122
|
+
graph_id: "<your-graph-id>",
|
|
123
|
+
cloud_url: "https://mcp.bluelens.dev",
|
|
124
|
+
api_key: "<your-secret-key>"
|
|
125
|
+
)
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Then configure your agent to use the cloud endpoint directly:
|
|
129
|
+
|
|
130
|
+
```json
|
|
131
|
+
{
|
|
132
|
+
"mcpServers": {
|
|
133
|
+
"bluelens-cloud": {
|
|
134
|
+
"type": "http",
|
|
135
|
+
"url": "https://mcp.bluelens.dev/api/mcp",
|
|
136
|
+
"headers": {
|
|
137
|
+
"Authorization": "Bearer <your-api-key>"
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
See [mcp.bluelens.dev](https://mcp.bluelens.dev) for full cloud documentation.
|
|
145
|
+
|
|
146
|
+
## Example prompts
|
|
147
|
+
|
|
148
|
+
Once connected, ask your agent:
|
|
149
|
+
|
|
150
|
+
- *"What are the main domains in this codebase?"*
|
|
151
|
+
- *"What is the blast radius of changing `src/services/auth.ts`?"*
|
|
152
|
+
- *"Is there a dependency path between `UserController` and `DatabasePool`?"*
|
|
153
|
+
- *"What changed structurally between last week's graph and today's?"*
|
|
154
|
+
- *"Enforce: the UI domain must never import from the database domain."*
|
|
155
|
+
|
|
156
|
+
## Data storage
|
|
157
|
+
|
|
158
|
+
By default, BlueLens stores data at `~/.bluelens/`:
|
|
159
|
+
|
|
160
|
+
```
|
|
161
|
+
~/.bluelens/
|
|
162
|
+
db.json # workspaces, folders, diagrams
|
|
163
|
+
codegraphs/
|
|
164
|
+
index.json # CodeGraph metadata
|
|
165
|
+
<id>.json # individual CodeGraph files
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Override the location with `BLUELENS_DATA_DIR`:
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
BLUELENS_DATA_DIR=/path/to/data bluelens-mcp
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## Links
|
|
175
|
+
|
|
176
|
+
- [BlueLens editor](https://app.bluelens.dev)
|
|
177
|
+
- [Cloud MCP docs](https://mcp.bluelens.dev)
|
|
178
|
+
- [GitHub](https://github.com/Nathanf22/BlueLens)
|
|
179
|
+
|
|
180
|
+
## License
|
|
181
|
+
|
|
182
|
+
MIT
|