statemap-mcp 0.1.11 → 0.1.12
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 +30 -28
- package/dist/index.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,39 +1,34 @@
|
|
|
1
1
|
# statemap-mcp
|
|
2
2
|
|
|
3
|
-
MCP server for [Statemap](https://statemap.io) — system state
|
|
3
|
+
MCP server for [Statemap](https://statemap.io) — system state management and architectural coherence for codebases.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Statemap tracks every data model, state container, transition, invariant, and read dependency in your system. It catches drift between your code and your architecture, enforces constraints automatically, and keeps your codebase structurally sound as it scales.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
### 1. Create a `.statemap` file in your repo root
|
|
7
|
+
This MCP server gives any compatible agent (Claude Code, Cursor, Windsurf, VS Code Copilot) direct access to your project's state model via tool calls.
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
{
|
|
13
|
-
"project_id": "your-project-id",
|
|
14
|
-
"base_url": "https://statemap.io"
|
|
15
|
-
}
|
|
16
|
-
```
|
|
9
|
+
## What Statemap does
|
|
17
10
|
|
|
18
|
-
|
|
11
|
+
- **Tracks system state** — data models, stores, transitions, invariants, and read dependencies, persisted across sessions
|
|
12
|
+
- **Enforces constraints** — uniqueness, referential integrity, missing fields, orphaned references — caught automatically
|
|
13
|
+
- **Detects drift** — diffs your actual source files (Prisma, SQL, TypeScript, Zustand) against the declared model
|
|
14
|
+
- **Guided cleanup** — architect review walks through every entity to identify dead state from pivots and fix broken wiring
|
|
15
|
+
- **CI integration** — GitHub Action posts divergence reports on PRs and blocks merges on invariant violations
|
|
19
16
|
|
|
20
|
-
|
|
17
|
+
## Setup
|
|
21
18
|
|
|
22
|
-
|
|
23
|
-
export STATEMAP_API_KEY="sm_your_key_here"
|
|
24
|
-
```
|
|
19
|
+
### 1. Create an account
|
|
25
20
|
|
|
26
|
-
|
|
21
|
+
Sign up at [statemap.io](https://statemap.io) and copy your API key from the **Keys** tab.
|
|
27
22
|
|
|
28
|
-
###
|
|
23
|
+
### 2. Add to your editor
|
|
29
24
|
|
|
30
25
|
#### Claude Code
|
|
31
26
|
|
|
32
27
|
```sh
|
|
33
|
-
claude mcp add statemap
|
|
28
|
+
claude mcp add statemap -e STATEMAP_API_KEY=sm_your_key_here -- npx -y statemap-mcp
|
|
34
29
|
```
|
|
35
30
|
|
|
36
|
-
Or add to `.claude
|
|
31
|
+
Or add to `.claude.json`:
|
|
37
32
|
|
|
38
33
|
```json
|
|
39
34
|
{
|
|
@@ -103,21 +98,28 @@ Add to `.vscode/mcp.json`:
|
|
|
103
98
|
}
|
|
104
99
|
```
|
|
105
100
|
|
|
101
|
+
### 3. Initialize
|
|
102
|
+
|
|
103
|
+
Tell your agent to run `statemap_init` — it creates a project and writes a `.statemap` config file to your repo root. From there it can scan your codebase, import your architecture, and start enforcing.
|
|
104
|
+
|
|
106
105
|
## Tools
|
|
107
106
|
|
|
108
107
|
| Tool | Description |
|
|
109
108
|
|------|-------------|
|
|
109
|
+
| `statemap_init` | Create or connect to a project |
|
|
110
110
|
| `statemap_snapshot` | Load the full system state model |
|
|
111
|
-
| `
|
|
112
|
-
| `
|
|
113
|
-
| `
|
|
111
|
+
| `statemap_list` | List entities by type with pagination |
|
|
112
|
+
| `statemap_search` | Query references, impact, readers, writers, storage, schemas |
|
|
113
|
+
| `statemap_validate` | Check all invariant constraints |
|
|
114
|
+
| `statemap_divergence` | Detect consistency issues |
|
|
114
115
|
| `statemap_update_model` | Create or update a data model |
|
|
115
116
|
| `statemap_update_container` | Create or update a state container |
|
|
116
117
|
| `statemap_update_transition` | Create or update a state transition |
|
|
117
118
|
| `statemap_add_invariant` | Add a constraint |
|
|
118
119
|
| `statemap_update_read_deps` | Create or update read dependencies |
|
|
119
|
-
| `statemap_import` | Bulk import entities |
|
|
120
|
+
| `statemap_import` | Bulk import entities (idempotent) |
|
|
120
121
|
| `statemap_analyze` | Submit source files for drift detection |
|
|
122
|
+
| `statemap_architect_review` | Guided dead-state cleanup session |
|
|
121
123
|
|
|
122
124
|
## Environment Variables
|
|
123
125
|
|
|
@@ -125,13 +127,13 @@ Add to `.vscode/mcp.json`:
|
|
|
125
127
|
|----------|----------|-------------|
|
|
126
128
|
| `STATEMAP_API_KEY` | Yes | Your Statemap API key (`sm_...`) |
|
|
127
129
|
| `STATEMAP_PROJECT_ID` | No | Override project ID (default: from `.statemap`) |
|
|
128
|
-
| `STATEMAP_BASE_URL` | No | Override
|
|
130
|
+
| `STATEMAP_BASE_URL` | No | Override API URL (default: `https://statemap.io`) |
|
|
129
131
|
|
|
130
|
-
## How
|
|
132
|
+
## How it works
|
|
131
133
|
|
|
132
|
-
The MCP server
|
|
134
|
+
The MCP server wraps the Statemap REST API. Each tool maps to one or more API calls. It reads `.statemap` from your working directory for the project ID, authenticates with `STATEMAP_API_KEY`, and communicates over stdio.
|
|
133
135
|
|
|
134
|
-
|
|
136
|
+
Your agent uses it to check existing architecture before writing code, update the state model after changes, enforce constraints continuously, and detect when code has drifted from the declared architecture.
|
|
135
137
|
|
|
136
138
|
## License
|
|
137
139
|
|
package/dist/index.js
CHANGED
|
@@ -294,7 +294,7 @@ let configError = "error" in loaded ? loaded.error : null;
|
|
|
294
294
|
let config = "error" in loaded ? { projectId: "", baseUrl: "", apiKey: "" } : loaded;
|
|
295
295
|
const server = new McpServer({
|
|
296
296
|
name: "statemap",
|
|
297
|
-
version: "0.1.
|
|
297
|
+
version: "0.1.12",
|
|
298
298
|
}, {
|
|
299
299
|
instructions: `Statemap is a system state model for this project. Here's how to get started:
|
|
300
300
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "statemap-mcp",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "MCP server for Statemap — system state
|
|
3
|
+
"version": "0.1.12",
|
|
4
|
+
"description": "MCP server for Statemap — system state management and architectural coherence for codebases",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"bin": {
|