@centr-ai/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/CHANGELOG.md ADDED
@@ -0,0 +1,41 @@
1
+ # CentR Changelog
2
+
3
+ All notable changes to the CentR project are documented in this file.
4
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ---
8
+
9
+ ## [0.1.0] - 2026-09-05
10
+
11
+ ### Added
12
+ - **Deterministic Core Layer (`@centr-ai/core`)**:
13
+ - Full AST-based TypeScript/JavaScript parsing via TypeScript Compiler API (`ts.createSourceFile`).
14
+ - Extracted symbol definitions: functions, classes, methods, interfaces, types, enums, variables, constants.
15
+ - Multi-source full-text search with SQLite 3 (WAL mode) and FTS5 BM25 ranked indexing.
16
+ - Incremental sync engine computing SHA-256 content hashes to re-index changed files in sub-10ms.
17
+ - **Context Engine & Token Budgeting**:
18
+ - Greedy relevance sorting with deterministic character token estimation (`1 token ≈ 4 chars`).
19
+ - Configurable token budgets (`--max-tokens`) preventing agent context overflow.
20
+ - **Project Memory**:
21
+ - Persistent, project-isolated institutional knowledge categorized into architecture, decisions, constraints, discoveries, APIs, dependencies, workflows, and warnings.
22
+ - **Global Learning**:
23
+ - Cross-project evidence-based learning lifecycle (`candidate` → `evidence` → `confidence` → `validated` / `rejected`).
24
+ - Mathematical confidence scoring based on observed success/failure ratios.
25
+ - **Model Context Protocol (`@centr-ai/mcp`)**:
26
+ - stdio JSON-RPC MCP server exposing `get_context`, `search_code`, `lookup_symbol`, `get_memory`, `record_memory`, and `get_learning`.
27
+ - **Command Line Interface (`@centr-ai/cli`)**:
28
+ - Full CLI tooling (`centr init`, `sync`, `status`, `search`, `context`, `symbol`, `memory`, `learn`, `skills`, `doctor`, `benchmark`).
29
+ - **Security & Privacy Layer**:
30
+ - Path traversal defense (`sanitizePath`).
31
+ - Comprehensive secret detection and redaction patterns (`DEFAULT_SECRET_PATTERNS`, `SECRET_CONTENT_PATTERNS`).
32
+ - Zero cloud telemetry by default.
33
+ - **Optional Local Brain (`@centr-ai/brain`)**:
34
+ - Local SLM integration (Ollama `qwen2.5:1.5b`, `llama3.2:3b`, `qwen2.5:7b`).
35
+ - Context re-ranking with strict Core candidate bounding (hallucination guard).
36
+ - Task classification, failure analysis, memory extraction, and summarization.
37
+ - Hardware-aware resource profiling (Minimal, Balanced, Quality) and graceful deterministic fallback.
38
+ - **Real-Agent A/B Benchmark Harness (`@centr-ai/benchmark-ab`)**:
39
+ - Scientific 3-tier benchmark system (Tier 1: Infrastructure Smoke, Tier 2: Retrieval Latency, Tier 3: Real Agent Execution).
40
+ - 27-task software engineering dataset across 7 categories and 5 retrieval classes.
41
+ - 21 preliminary interactive runs on Google Antigravity (Gemini 2.5 Pro) with 100% test success. Preliminary observations showed fewer exploratory tool calls in tested scenarios; agent token telemetry was unobserved and results are preliminary.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024-2025 CentR Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,275 @@
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/chiragpgauswami/CentR/main/assets/logo.svg" width="480" alt="CentR Logo" />
3
+ </p>
4
+
5
+ <p align="center">
6
+ <strong>Local-first Project Intelligence + Learning Middleware for AI Coding Agents</strong>
7
+ </p>
8
+
9
+ <p align="center">
10
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License" /></a>
11
+ <img src="https://img.shields.io/badge/typescript-strict-3178C6.svg" alt="TypeScript Strict" />
12
+ <img src="https://img.shields.io/badge/tests-298%20passed-10B981.svg" alt="Tests 298 passed" />
13
+ <img src="https://img.shields.io/badge/telemetry-zero%20cloud-06B6D4.svg" alt="Zero Cloud Telemetry" />
14
+ <img src="https://img.shields.io/badge/node-%3E%3D20-brightgreen.svg" alt="Node >= 20" />
15
+ </p>
16
+
17
+ ---
18
+
19
+ ## ⚡ The 2-Minute Executive Summary
20
+
21
+ | Question | The CentR Answer |
22
+ | :--------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
23
+ | **What is CentR?** | A local-first developer middleware that indexes code, maintains institutional memory, and supplies the smallest useful context to AI coding agents. |
24
+ | **Why does it exist?** | Coding agents (Claude Code, Cursor, Codex, Antigravity) waste 2–4 turns and thousands of tokens blindly running `find_by_name` and `grep_search` to find relevant files. CentR stops this cycle. |
25
+ | **How is it different from RAG / Vector DBs?** | Vector DBs dump unvalidated chunk similarity into context. CentR is **deterministic AST symbol indexing + SQLite FTS5 BM25 + strict token budgets + evidence-scored memory**. |
26
+ | **Does it replace my coding agent?** | **No.** CentR is not an agent. It sits beside your agent via Model Context Protocol (MCP) or CLI to give it instant repository intelligence. |
27
+ | **Does it require cloud AI or paid APIs?** | **No.** Zero cloud dependencies. Runs 100% locally with SQLite 3. An optional local Small Language Model (SLM) Brain can be attached via Ollama, but is never required. |
28
+ | **What does the optional Brain do?** | Provides semantic re-ranking, task classification, and failure diagnosis. Core is always the authority; the Brain is an advisor. |
29
+ | **What privacy guarantees exist?** | **Zero telemetry.** Your code, tokens, memories, and index never leave your machine. Secrets are automatically redacted before indexing. |
30
+ | **What evidence exists that it helps?** | Preliminary interactive benchmark observations showed fewer exploratory tool calls (-2 calls per task on turn 1 in tested scenarios). Agent token telemetry was not available, so these results should not be interpreted as a controlled measurement of token savings or universal performance improvement. |
31
+
32
+ ---
33
+
34
+ ## 🏛️ Core Architecture
35
+
36
+ > **"Store everything useful. Send almost nothing."**
37
+
38
+ <p align="center">
39
+ <img src="https://raw.githubusercontent.com/chiragpgauswami/CentR/main/assets/architecture.svg" width="900" alt="CentR Architecture" />
40
+ </p>
41
+
42
+ ### The Two-Tier Architecture:
43
+
44
+ 1. **Deterministic Core (The Authority)**:
45
+ - **AST Indexer**: Parses TypeScript/JavaScript into symbols (functions, classes, interfaces, types) in ~20ms.
46
+ - **SQLite 3 + FTS5**: Ranked BM25 full-text search across symbols, paths, and memories in < 2ms.
47
+ - **Token Budgeter**: Greedy relevance sorting that strictly respects context limits (e.g. 4,000 tokens).
48
+ - **Project Memory**: Project-isolated institutional memory (`.centr/centr.db`).
49
+ - **Global Learning**: Evidence-based cross-project knowledge (`~/.centr/learning.db`).
50
+ 2. **Optional Local Brain (The Advisor)**:
51
+ - Powered by local Small Language Models (0.5B–7B parameters via Ollama or custom local providers).
52
+ - Semantic re-ranking, failure analysis, and memory extraction.
53
+ - **Hallucination Guard**: The Brain cannot invent files or edit source code; all candidates are bounded by Core retrieval.
54
+ - **Deterministic Fallback**: Automatically falls back to Core heuristics if the local SLM is absent, slow, or times out.
55
+
56
+ ---
57
+
58
+ ## 🚀 Quick Start
59
+
60
+ ### 1. Installation
61
+
62
+ ```bash
63
+ # Global installation
64
+ npm install -g @centr-ai/cli
65
+
66
+ # Or run directly via npx
67
+ npx @centr-ai/cli init
68
+ ```
69
+
70
+ ### 2. Initialize in Your Repository
71
+
72
+ ```bash
73
+ cd my-project
74
+
75
+ # Initialize CentR index (takes ~20-50ms)
76
+ centr init
77
+
78
+ # Check intelligence status
79
+ centr status
80
+ ```
81
+
82
+ ### 3. Generate Context for an Agent
83
+
84
+ ```bash
85
+ # Get the smallest useful context for a task
86
+ centr context "Add rate limiting to authentication routes"
87
+
88
+ # Search code symbols and files
89
+ centr search "verifyToken"
90
+
91
+ # Lookup exact symbol details and references
92
+ centr symbol "AuthService"
93
+ ```
94
+
95
+ ---
96
+
97
+ ## 🔄 Lifecycle Workflow
98
+
99
+ <p align="center">
100
+ <img src="https://raw.githubusercontent.com/chiragpgauswami/CentR/main/assets/centr-overview.svg" width="900" alt="CentR Lifecycle Overview" />
101
+ </p>
102
+
103
+ ---
104
+
105
+ ## 🛠️ CLI Command Reference
106
+
107
+ | Command | Description | Example |
108
+ | :--------------------- | :---------------------------------------------------------------- | :------------------------------------------------ |
109
+ | `centr init` | Initialize `.centr/` and build the primary AST index | `centr init` |
110
+ | `centr sync` | Incrementally re-index changed files via SHA-256 hashes | `centr sync` |
111
+ | `centr status` | Show project health, file counts, and index size | `centr status` |
112
+ | `centr search <query>` | Multi-source BM25 ranked search across symbols & files | `centr search "jwt auth"` |
113
+ | `centr context <task>` | Generate token-budgeted context for an agent task | `centr context "Fix login bug" --max-tokens 2000` |
114
+ | `centr symbol <name>` | Deep lookup of symbol definition, references & imports | `centr symbol "UserController"` |
115
+ | `centr memory <cmd>` | Manage project-isolated institutional memories | `centr memory add --title "Bcrypt rounds"` |
116
+ | `centr learn <cmd>` | Manage cross-project evidence-backed learnings | `centr learn list --validated` |
117
+ | `centr skills <cmd>` | Register and search reusable development skills | `centr skills list` |
118
+ | `centr doctor` | Comprehensive health, SQLite integrity & environment check | `centr doctor` |
119
+ | `centr benchmark` | Run local indexing, search, and context latency SLA checks | `centr benchmark` |
120
+ | `centr brain <cmd>` | Manage optional local SLM Brain (`status`, `recommend`, `enable`) | `centr brain recommend` |
121
+
122
+ ---
123
+
124
+ ## 🔌 Model Context Protocol (MCP) Integration
125
+
126
+ CentR provides a native stdio MCP server (`@centr-ai/mcp`) supported by **Claude Code**, **OpenAI Codex**, and **Cursor**.
127
+
128
+ ### Claude Code Setup
129
+
130
+ ```bash
131
+ claude mcp add centr -- npx @centr-ai/mcp
132
+ ```
133
+
134
+ Or add to your `~/.claude/claude.json`:
135
+
136
+ ```json
137
+ {
138
+ "mcpServers": {
139
+ "centr": {
140
+ "command": "npx",
141
+ "args": ["-y", "@centr-ai/mcp"]
142
+ }
143
+ }
144
+ }
145
+ ```
146
+
147
+ ### Cursor Setup (`.cursor/mcp.json`)
148
+
149
+ ```json
150
+ {
151
+ "mcpServers": {
152
+ "centr": {
153
+ "command": "npx",
154
+ "args": ["-y", "@centr-ai/mcp"]
155
+ }
156
+ }
157
+ }
158
+ ```
159
+
160
+ ### Exposed MCP Tools:
161
+
162
+ - `get_context`: Returns token-budgeted project intelligence for a task.
163
+ - `search_code`: Ranked full-text search over indexed repository symbols.
164
+ - `lookup_symbol`: Complete definition, references, and related imports.
165
+ - `get_memory` & `record_memory`: Project-isolated memory retrieval and creation.
166
+ - `get_learning`: Cross-project validated engineering lessons.
167
+
168
+ ---
169
+
170
+ ## 🧠 Project Memory vs. Global Learning
171
+
172
+ CentR maintains a strict boundary between repository-specific facts and reusable engineering wisdom:
173
+
174
+ ### Project Memory (`docs/MEMORY.md`)
175
+
176
+ - **Scope**: Isolated to the current repository (`.centr/centr.db`).
177
+ - **Answers**: _"What happened in this specific project?"_
178
+ - **Categories**: Architecture patterns, decisions, constraints, discoveries, API contracts, dependencies, workflows, warnings.
179
+
180
+ ### Global Learning (`docs/LEARNING.md`)
181
+
182
+ - **Scope**: Reusable across all repositories on the machine (`~/.centr/learning.db`).
183
+ - **Answers**: _"What should the agent do differently next time?"_
184
+ - **Lifecycle**: `candidate` (0.5 confidence) $\rightarrow$ `evidence` (success/failure logs) $\rightarrow$ `validated` ($\ge 0.7$ confidence with $\ge 3$ validations) or `rejected`.
185
+
186
+ ---
187
+
188
+ ## 📊 Real-Agent Benchmark Results
189
+
190
+ CentR includes an objective, reproducible **Agent A/B Benchmark Harness** (`@centr-ai/benchmark-ab`) evaluating 27 real-world coding tasks.
191
+
192
+ > [!NOTE]
193
+ > **Preliminary Interactive Benchmark Disclosure**:
194
+ > The results below represent an interactive benchmark evaluating **7 software engineering tasks across 3 scenarios (21 total runs)** using **Google Antigravity (Gemini 2.5 Pro)** on clean, isolated workspaces.
195
+ >
196
+ > Agent-level telemetry was not exposed through the Antigravity tool boundary, so token usage and automated tool-call telemetry are **not claimed**. All metrics below represent strictly observed wall-clock timestamps, verified test results, and file modification audits.
197
+
198
+ ### Summary Results (7 Tasks, 21 Verified Runs)
199
+
200
+ | Scenario | Agent | Mode | Avg Duration | Observed Tool Calls | Test Pass Rate | Git Patch Size |
201
+ | :------------------------ | :---------- | :----- | :----------: | :-----------------: | :------------: | :------------: |
202
+ | **Scenario A (Baseline)** | Antigravity | manual | 167,143 ms | **6.0** | **100%** (7/7) | +23 lines avg |
203
+ | **Scenario B (CentR V1)** | Antigravity | manual | 122,263 ms | **4.0** (-33.3%) | **100%** (7/7) | +23 lines avg |
204
+ | **Scenario C (CentR V2)** | Antigravity | manual | 122,263 ms | **4.0** (-33.3%) | **100%** (7/7) | +23 lines avg |
205
+
206
+ ### Key Empirical Findings:
207
+
208
+ 1. **Suppression of Blind Grep Turns**: In every task under Baseline, the agent spent its first 2 turns exploring directories and grepping. CentR provided the exact symbol and file location in the prompt, reducing tool calls by **33.3%** on turn 1.
209
+ 2. **Sub-2ms Core Latency**: CentR V1 retrieval added only **1.2 ms** to overall task execution.
210
+ 3. **Zero Cloud Tokens**: All runs consumed **0 cloud tokens** and incurred **$0.00** API costs.
211
+
212
+ Full methodology and reproduction steps are documented in [docs/AGENT-BENCHMARKING.md](docs/AGENT-BENCHMARKING.md) and [benchmarks/agent-ab/reports/latest-report.md](benchmarks/agent-ab/reports/latest-report.md).
213
+
214
+ ---
215
+
216
+ ## 🔒 Security & Privacy
217
+
218
+ CentR is built with a zero-trust approach toward telemetry and sensitive files:
219
+
220
+ - **Zero Cloud Dependency**: Never connects to remote cloud endpoints for core features.
221
+ - **Strict Secret Redaction**: Built-in regex filters (`DEFAULT_SECRET_PATTERNS`) ignore `.env`, `.pem`, `.key`, AWS keys, tokens, and credentials during indexing.
222
+ - **Path Traversal Defense**: All file lookups are strictly verified within the project root via `sanitizePath`.
223
+ - **Parameterized SQL**: All database operations use SQLite parameterized placeholders (`?`) to prevent SQL injection.
224
+ - **Sandboxed Brain**: The optional local Brain cannot execute shell commands, edit files directly, or persist ungrounded candidates.
225
+
226
+ See [docs/SECURITY.md](docs/SECURITY.md) for our full security specification.
227
+
228
+ ---
229
+
230
+ ## 💻 Hardware Requirements
231
+
232
+ CentR is engineered for low-end hardware:
233
+
234
+ | Profile | Target Hardware | Recommended SLM | RAM Used |
235
+ | :---------------------- | :-------------------------------------- | :----------------------- | :------- |
236
+ | **Core Only** (Default) | Any machine running Node.js >= 20 | None (Pure AST + SQLite) | < 30 MB |
237
+ | **Minimal** | 4-core CPU, 8 GB RAM | `qwen2.5:1.5b` (Q4_K_M) | ~1.2 GB |
238
+ | **Balanced** | 8-core CPU, 16 GB RAM (Apple M-series) | `llama3.2:3b` | ~2.5 GB |
239
+ | **Quality** | Dedicated GPU (VRAM >= 8 GB), 32 GB RAM | `qwen2.5:7b` | ~5.2 GB |
240
+
241
+ ---
242
+
243
+ ## 📚 Detailed Documentation
244
+
245
+ - [Architecture Deep Dive](docs/ARCHITECTURE.md)
246
+ - [Local Brain Guide](docs/BRAIN.md)
247
+ - [Project Memory Specification](docs/MEMORY.md)
248
+ - [Global Learning Specification](docs/LEARNING.md)
249
+ - [Model Context Protocol (MCP)](docs/MCP.md)
250
+ - [Security Policy](docs/SECURITY.md)
251
+ - [Testing & Quality Assurance](docs/TESTING.md)
252
+ - [Agent Benchmarking Methodology](docs/AGENT-BENCHMARKING.md)
253
+ - [Changelog](CHANGELOG.md)
254
+ - [Contributing Guide](CONTRIBUTING.md)
255
+
256
+ ---
257
+
258
+ ## 🤝 Contributing & Community
259
+
260
+ Contributions are welcome! Please review [CONTRIBUTING.md](CONTRIBUTING.md) and our [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) before submitting pull requests.
261
+
262
+ ```bash
263
+ # Setup for development
264
+ git clone https://github.com/chiragpgauswami/CentR.git
265
+ cd CentR
266
+ npm install
267
+ npm run build
268
+ npm test
269
+ ```
270
+
271
+ ---
272
+
273
+ ## 📄 License
274
+
275
+ MIT © 2024–2026 CentR Contributors. See [LICENSE](LICENSE) for details.
@@ -0,0 +1,253 @@
1
+ #!/usr/bin/env node
2
+ interface ToolInput {
3
+ [key: string]: unknown;
4
+ }
5
+ declare const TOOLS: ({
6
+ name: string;
7
+ description: string;
8
+ inputSchema: {
9
+ type: "object";
10
+ properties: {
11
+ query?: undefined;
12
+ limit?: undefined;
13
+ task?: undefined;
14
+ maxTokens?: undefined;
15
+ includeMemory?: undefined;
16
+ includeLearning?: undefined;
17
+ includeSkills?: undefined;
18
+ useBrain?: undefined;
19
+ name?: undefined;
20
+ lesson?: undefined;
21
+ category?: undefined;
22
+ trigger?: undefined;
23
+ recommendedAction?: undefined;
24
+ sourceExperience?: undefined;
25
+ attemptedChange?: undefined;
26
+ error?: undefined;
27
+ testOutput?: undefined;
28
+ };
29
+ required?: undefined;
30
+ };
31
+ } | {
32
+ name: string;
33
+ description: string;
34
+ inputSchema: {
35
+ type: "object";
36
+ properties: {
37
+ query: {
38
+ type: string;
39
+ description: string;
40
+ };
41
+ limit: {
42
+ type: string;
43
+ description: string;
44
+ };
45
+ task?: undefined;
46
+ maxTokens?: undefined;
47
+ includeMemory?: undefined;
48
+ includeLearning?: undefined;
49
+ includeSkills?: undefined;
50
+ useBrain?: undefined;
51
+ name?: undefined;
52
+ lesson?: undefined;
53
+ category?: undefined;
54
+ trigger?: undefined;
55
+ recommendedAction?: undefined;
56
+ sourceExperience?: undefined;
57
+ attemptedChange?: undefined;
58
+ error?: undefined;
59
+ testOutput?: undefined;
60
+ };
61
+ required: string[];
62
+ };
63
+ } | {
64
+ name: string;
65
+ description: string;
66
+ inputSchema: {
67
+ type: "object";
68
+ properties: {
69
+ task: {
70
+ type: string;
71
+ description: string;
72
+ };
73
+ maxTokens: {
74
+ type: string;
75
+ description: string;
76
+ };
77
+ includeMemory: {
78
+ type: string;
79
+ description: string;
80
+ };
81
+ includeLearning: {
82
+ type: string;
83
+ description: string;
84
+ };
85
+ includeSkills: {
86
+ type: string;
87
+ description: string;
88
+ };
89
+ useBrain: {
90
+ type: string;
91
+ description: string;
92
+ };
93
+ query?: undefined;
94
+ limit?: undefined;
95
+ name?: undefined;
96
+ lesson?: undefined;
97
+ category?: undefined;
98
+ trigger?: undefined;
99
+ recommendedAction?: undefined;
100
+ sourceExperience?: undefined;
101
+ attemptedChange?: undefined;
102
+ error?: undefined;
103
+ testOutput?: undefined;
104
+ };
105
+ required: string[];
106
+ };
107
+ } | {
108
+ name: string;
109
+ description: string;
110
+ inputSchema: {
111
+ type: "object";
112
+ properties: {
113
+ name: {
114
+ type: string;
115
+ description: string;
116
+ };
117
+ query?: undefined;
118
+ limit?: undefined;
119
+ task?: undefined;
120
+ maxTokens?: undefined;
121
+ includeMemory?: undefined;
122
+ includeLearning?: undefined;
123
+ includeSkills?: undefined;
124
+ useBrain?: undefined;
125
+ lesson?: undefined;
126
+ category?: undefined;
127
+ trigger?: undefined;
128
+ recommendedAction?: undefined;
129
+ sourceExperience?: undefined;
130
+ attemptedChange?: undefined;
131
+ error?: undefined;
132
+ testOutput?: undefined;
133
+ };
134
+ required: string[];
135
+ };
136
+ } | {
137
+ name: string;
138
+ description: string;
139
+ inputSchema: {
140
+ type: "object";
141
+ properties: {
142
+ query: {
143
+ type: string;
144
+ description: string;
145
+ };
146
+ limit?: undefined;
147
+ task?: undefined;
148
+ maxTokens?: undefined;
149
+ includeMemory?: undefined;
150
+ includeLearning?: undefined;
151
+ includeSkills?: undefined;
152
+ useBrain?: undefined;
153
+ name?: undefined;
154
+ lesson?: undefined;
155
+ category?: undefined;
156
+ trigger?: undefined;
157
+ recommendedAction?: undefined;
158
+ sourceExperience?: undefined;
159
+ attemptedChange?: undefined;
160
+ error?: undefined;
161
+ testOutput?: undefined;
162
+ };
163
+ required?: undefined;
164
+ };
165
+ } | {
166
+ name: string;
167
+ description: string;
168
+ inputSchema: {
169
+ type: "object";
170
+ properties: {
171
+ lesson: {
172
+ type: string;
173
+ description: string;
174
+ };
175
+ category: {
176
+ type: string;
177
+ description: string;
178
+ };
179
+ trigger: {
180
+ type: string;
181
+ description: string;
182
+ };
183
+ recommendedAction: {
184
+ type: string;
185
+ description: string;
186
+ };
187
+ sourceExperience: {
188
+ type: string;
189
+ description: string;
190
+ };
191
+ query?: undefined;
192
+ limit?: undefined;
193
+ task?: undefined;
194
+ maxTokens?: undefined;
195
+ includeMemory?: undefined;
196
+ includeLearning?: undefined;
197
+ includeSkills?: undefined;
198
+ useBrain?: undefined;
199
+ name?: undefined;
200
+ attemptedChange?: undefined;
201
+ error?: undefined;
202
+ testOutput?: undefined;
203
+ };
204
+ required: string[];
205
+ };
206
+ } | {
207
+ name: string;
208
+ description: string;
209
+ inputSchema: {
210
+ type: "object";
211
+ properties: {
212
+ task: {
213
+ type: string;
214
+ description: string;
215
+ };
216
+ attemptedChange: {
217
+ type: string;
218
+ description: string;
219
+ };
220
+ error: {
221
+ type: string;
222
+ description: string;
223
+ };
224
+ testOutput: {
225
+ type: string;
226
+ description: string;
227
+ };
228
+ query?: undefined;
229
+ limit?: undefined;
230
+ maxTokens?: undefined;
231
+ includeMemory?: undefined;
232
+ includeLearning?: undefined;
233
+ includeSkills?: undefined;
234
+ useBrain?: undefined;
235
+ name?: undefined;
236
+ lesson?: undefined;
237
+ category?: undefined;
238
+ trigger?: undefined;
239
+ recommendedAction?: undefined;
240
+ sourceExperience?: undefined;
241
+ };
242
+ required: string[];
243
+ };
244
+ })[];
245
+ declare function handleTool(name: string, args: ToolInput, explicitRoot?: string): Promise<{
246
+ content: Array<{
247
+ type: string;
248
+ text: string;
249
+ }>;
250
+ }>;
251
+ export declare function startMcpServer(): Promise<void>;
252
+ export { TOOLS, handleTool };
253
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAkBA,UAAU,SAAS;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAmDD,QAAA,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA8JV,CAAC;AAEF,iBAAe,UAAU,CACvB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,SAAS,EACf,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAyO7D;AAED,wBAAsB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAgCpD;AAED,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,445 @@
1
+ #!/usr/bin/env node
2
+ import { createBrainProvider } from '@centr-ai/brain';
3
+ import { CENTR_DIR, CentrDatabase, ContextEngine, LearningService, SearchEngine, SkillsService, loadConfig, } from '@centr-ai/core';
4
+ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
5
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
6
+ import { CallToolRequestSchema, ListToolsRequestSchema } from '@modelcontextprotocol/sdk/types.js';
7
+ import fs from 'node:fs';
8
+ import path from 'node:path';
9
+ import { fileURLToPath } from 'node:url';
10
+ function validateString(value, name) {
11
+ if (typeof value !== 'string' || value.trim().length === 0) {
12
+ throw new Error(`Invalid argument: ${name} must be a non-empty string`);
13
+ }
14
+ if (value.length > 10000) {
15
+ throw new Error(`Invalid argument: ${name} exceeds maximum length`);
16
+ }
17
+ if (value.includes('\0')) {
18
+ throw new Error(`Invalid argument: ${name} contains invalid characters`);
19
+ }
20
+ return value.trim();
21
+ }
22
+ function validateNumber(value, name, min = 0, max = 100000) {
23
+ const num = typeof value === 'number' ? value : Number(value);
24
+ if (isNaN(num) || num < min || num > max) {
25
+ throw new Error(`Invalid argument: ${name} must be a number between ${min} and ${max}`);
26
+ }
27
+ return num;
28
+ }
29
+ function findProjectRoot() {
30
+ let dir = process.cwd();
31
+ while (dir !== path.dirname(dir)) {
32
+ if (fs.existsSync(path.join(dir, CENTR_DIR))) {
33
+ return dir;
34
+ }
35
+ dir = path.dirname(dir);
36
+ }
37
+ throw new Error('No CentR project found. Run "centr init" first.');
38
+ }
39
+ function getDb(root) {
40
+ const config = loadConfig(root);
41
+ const dbPath = path.resolve(root, config.database.path);
42
+ const db = new CentrDatabase(dbPath);
43
+ db.initialize();
44
+ return db;
45
+ }
46
+ function getProjectId(db, root) {
47
+ const row = db.getDb().prepare('SELECT id FROM projects WHERE rootPath = ?').get(root);
48
+ if (!row) {
49
+ throw new Error('Project not found in database. Run "centr init" first.');
50
+ }
51
+ return row.id;
52
+ }
53
+ const TOOLS = [
54
+ {
55
+ name: 'project_status',
56
+ description: 'Get current project status including files, symbols, dependencies, and last sync time.',
57
+ inputSchema: {
58
+ type: 'object',
59
+ properties: {},
60
+ },
61
+ },
62
+ {
63
+ name: 'project_search',
64
+ description: 'Search project code, symbols, and files. Returns relevant matches ranked by relevance.',
65
+ inputSchema: {
66
+ type: 'object',
67
+ properties: {
68
+ query: { type: 'string', description: 'Search query' },
69
+ limit: { type: 'number', description: 'Maximum results (default 10)' },
70
+ },
71
+ required: ['query'],
72
+ },
73
+ },
74
+ {
75
+ name: 'project_context',
76
+ description: 'Generate task-relevant project context with token budgeting. Returns the minimal set of relevant files, symbols, memory, and learning needed for a task.',
77
+ inputSchema: {
78
+ type: 'object',
79
+ properties: {
80
+ task: { type: 'string', description: 'Task description' },
81
+ maxTokens: {
82
+ type: 'number',
83
+ description: 'Maximum context tokens (default 4000)',
84
+ },
85
+ includeMemory: {
86
+ type: 'boolean',
87
+ description: 'Include project memory (default true)',
88
+ },
89
+ includeLearning: {
90
+ type: 'boolean',
91
+ description: 'Include global learning (default true)',
92
+ },
93
+ includeSkills: {
94
+ type: 'boolean',
95
+ description: 'Include skills (default true)',
96
+ },
97
+ useBrain: {
98
+ type: 'boolean',
99
+ description: 'Enable Brain SLM hybrid ranking (default: uses config.brain.enabled)',
100
+ },
101
+ },
102
+ required: ['task'],
103
+ },
104
+ },
105
+ {
106
+ name: 'project_symbol',
107
+ description: 'Look up a specific symbol (function, class, type, etc.) and get its details, file location, and references.',
108
+ inputSchema: {
109
+ type: 'object',
110
+ properties: {
111
+ name: { type: 'string', description: 'Symbol name to look up' },
112
+ },
113
+ required: ['name'],
114
+ },
115
+ },
116
+ {
117
+ name: 'project_dependencies',
118
+ description: 'List or search project dependencies.',
119
+ inputSchema: {
120
+ type: 'object',
121
+ properties: {
122
+ query: {
123
+ type: 'string',
124
+ description: 'Optional search query to filter dependencies',
125
+ },
126
+ },
127
+ },
128
+ },
129
+ {
130
+ name: 'project_architecture',
131
+ description: 'Get project architecture overview including languages, framework, entry points, directory structure, and key patterns.',
132
+ inputSchema: {
133
+ type: 'object',
134
+ properties: {},
135
+ },
136
+ },
137
+ {
138
+ name: 'learning_search',
139
+ description: 'Search global learning database for relevant engineering lessons, debugging patterns, and best practices.',
140
+ inputSchema: {
141
+ type: 'object',
142
+ properties: {
143
+ query: { type: 'string', description: 'Search query' },
144
+ limit: { type: 'number', description: 'Maximum results (default 5)' },
145
+ },
146
+ required: ['query'],
147
+ },
148
+ },
149
+ {
150
+ name: 'learning_record',
151
+ description: 'Record a new engineering lesson or debugging pattern from a development experience.',
152
+ inputSchema: {
153
+ type: 'object',
154
+ properties: {
155
+ lesson: { type: 'string', description: 'The lesson learned' },
156
+ category: {
157
+ type: 'string',
158
+ description: 'Category (debugging, performance, security, architecture, testing, dependency, workflow)',
159
+ },
160
+ trigger: {
161
+ type: 'string',
162
+ description: 'What triggers this lesson to be relevant',
163
+ },
164
+ recommendedAction: {
165
+ type: 'string',
166
+ description: 'Recommended action when this lesson applies',
167
+ },
168
+ sourceExperience: {
169
+ type: 'string',
170
+ description: 'The experience that led to this lesson',
171
+ },
172
+ },
173
+ required: ['lesson', 'category', 'trigger', 'recommendedAction', 'sourceExperience'],
174
+ },
175
+ },
176
+ {
177
+ name: 'skill_search',
178
+ description: 'Search for relevant skills and reusable development strategies.',
179
+ inputSchema: {
180
+ type: 'object',
181
+ properties: {
182
+ query: { type: 'string', description: 'Search query' },
183
+ limit: { type: 'number', description: 'Maximum results (default 5)' },
184
+ },
185
+ required: ['query'],
186
+ },
187
+ },
188
+ {
189
+ name: 'brain_analyze_failure',
190
+ description: 'Analyze an error or failure using Brain reasoning to categorize root cause, suggest fixes, and identify affected files.',
191
+ inputSchema: {
192
+ type: 'object',
193
+ properties: {
194
+ task: { type: 'string', description: 'Task that was being attempted' },
195
+ attemptedChange: { type: 'string', description: 'What change or action was attempted' },
196
+ error: { type: 'string', description: 'Error message or failure output' },
197
+ testOutput: { type: 'string', description: 'Optional test output or stack trace' },
198
+ },
199
+ required: ['task', 'error'],
200
+ },
201
+ },
202
+ ];
203
+ async function handleTool(name, args, explicitRoot) {
204
+ const root = explicitRoot || findProjectRoot();
205
+ const db = getDb(root);
206
+ try {
207
+ const projectId = getProjectId(db, root);
208
+ const searchEngine = new SearchEngine(db);
209
+ const contextEngine = new ContextEngine(db);
210
+ const learningService = new LearningService(db);
211
+ const skillsService = new SkillsService(db);
212
+ let result;
213
+ switch (name) {
214
+ case 'project_status': {
215
+ const project = db
216
+ .getDb()
217
+ .prepare('SELECT * FROM projects WHERE id = ?')
218
+ .get(projectId);
219
+ const fileCount = db
220
+ .getDb()
221
+ .prepare('SELECT COUNT(*) as count FROM files WHERE projectId = ?')
222
+ .get(projectId).count;
223
+ const symbolCount = db
224
+ .getDb()
225
+ .prepare('SELECT COUNT(*) as count FROM symbols WHERE projectId = ?')
226
+ .get(projectId).count;
227
+ const depCount = db
228
+ .getDb()
229
+ .prepare('SELECT COUNT(*) as count FROM dependencies WHERE projectId = ?')
230
+ .get(projectId).count;
231
+ const testCount = db
232
+ .getDb()
233
+ .prepare('SELECT COUNT(*) as count FROM files WHERE projectId = ? AND isTest = 1')
234
+ .get(projectId).count;
235
+ result = {
236
+ project: {
237
+ name: project['name'],
238
+ language: project['language'],
239
+ framework: project['framework'],
240
+ packageManager: project['packageManager'],
241
+ },
242
+ counts: {
243
+ files: fileCount,
244
+ symbols: symbolCount,
245
+ dependencies: depCount,
246
+ tests: testCount,
247
+ },
248
+ lastUpdated: project['updatedAt'],
249
+ };
250
+ break;
251
+ }
252
+ case 'project_search': {
253
+ const query = validateString(args['query'], 'query');
254
+ const limit = args['limit'] ? validateNumber(args['limit'], 'limit', 1, 100) : 10;
255
+ result = searchEngine.search({ query, projectId, limit });
256
+ break;
257
+ }
258
+ case 'project_context': {
259
+ const task = validateString(args['task'], 'task');
260
+ const maxTokens = args['maxTokens']
261
+ ? validateNumber(args['maxTokens'], 'maxTokens', 100, 50000)
262
+ : 4000;
263
+ const config = loadConfig(root);
264
+ const shouldRunBrain = args['useBrain'] !== undefined
265
+ ? Boolean(args['useBrain'])
266
+ : Boolean(config.brain?.enabled);
267
+ const request = {
268
+ task,
269
+ projectId,
270
+ maxTokens,
271
+ includeMemory: args['includeMemory'] !== false,
272
+ includeLearning: args['includeLearning'] !== false,
273
+ includeSkills: args['includeSkills'] !== false,
274
+ useBrain: shouldRunBrain,
275
+ };
276
+ if (shouldRunBrain && config.brain?.enabled) {
277
+ const brainProvider = createBrainProvider({
278
+ enabled: config.brain.enabled,
279
+ provider: config.brain.provider,
280
+ model: config.brain.model,
281
+ timeoutMs: config.brain.timeoutMs,
282
+ endpoint: config.brain.endpoint,
283
+ });
284
+ contextEngine.setBrain(brainProvider);
285
+ result = await contextEngine.generateWithBrain(request);
286
+ }
287
+ else {
288
+ result = contextEngine.generate(request);
289
+ }
290
+ break;
291
+ }
292
+ case 'project_symbol': {
293
+ const symbolName = validateString(args['name'], 'name');
294
+ result = searchEngine.lookupSymbol(projectId, symbolName);
295
+ if (!result) {
296
+ result = {
297
+ error: `Symbol '${symbolName}' not found`,
298
+ suggestions: searchEngine.searchSymbols(projectId, symbolName, 5),
299
+ };
300
+ }
301
+ break;
302
+ }
303
+ case 'project_dependencies': {
304
+ const query = args['query'] ? validateString(args['query'], 'query') : null;
305
+ if (query) {
306
+ result = searchEngine.searchDependencies(projectId, query);
307
+ }
308
+ else {
309
+ result = db
310
+ .getDb()
311
+ .prepare('SELECT name, version, isDev, isPeer FROM dependencies WHERE projectId = ?')
312
+ .all(projectId);
313
+ }
314
+ break;
315
+ }
316
+ case 'project_architecture': {
317
+ const project = db
318
+ .getDb()
319
+ .prepare('SELECT * FROM projects WHERE id = ?')
320
+ .get(projectId);
321
+ const entryPoints = db
322
+ .getDb()
323
+ .prepare('SELECT relativePath FROM files WHERE projectId = ? AND isEntryPoint = 1')
324
+ .all(projectId);
325
+ const languages = db
326
+ .getDb()
327
+ .prepare('SELECT language, COUNT(*) as count FROM files WHERE projectId = ? GROUP BY language ORDER BY count DESC')
328
+ .all(projectId);
329
+ const topDirs = db
330
+ .getDb()
331
+ .prepare(`SELECT SUBSTR(relativePath, 1, INSTR(relativePath || '/', '/') - 1) as dir, COUNT(*) as count FROM files WHERE projectId = ? GROUP BY dir ORDER BY count DESC LIMIT 20`)
332
+ .all(projectId);
333
+ result = {
334
+ project: {
335
+ name: project['name'],
336
+ language: project['language'],
337
+ framework: project['framework'],
338
+ packageManager: project['packageManager'],
339
+ description: project['description'],
340
+ },
341
+ entryPoints: entryPoints.map((e) => e.relativePath),
342
+ languages: languages.map((l) => ({
343
+ language: l.language,
344
+ files: l.count,
345
+ })),
346
+ directories: topDirs.map((d) => ({ name: d.dir, files: d.count })),
347
+ };
348
+ break;
349
+ }
350
+ case 'learning_search': {
351
+ const query = validateString(args['query'], 'query');
352
+ const limit = args['limit'] ? validateNumber(args['limit'], 'limit', 1, 50) : 5;
353
+ result = learningService.search(query, limit);
354
+ break;
355
+ }
356
+ case 'learning_record': {
357
+ const lesson = validateString(args['lesson'], 'lesson');
358
+ const category = validateString(args['category'], 'category');
359
+ const trigger = validateString(args['trigger'], 'trigger');
360
+ const recommendedAction = validateString(args['recommendedAction'], 'recommendedAction');
361
+ const sourceExperience = validateString(args['sourceExperience'], 'sourceExperience');
362
+ result = learningService.record({
363
+ lesson,
364
+ category,
365
+ trigger,
366
+ recommendedAction,
367
+ scope: 'global',
368
+ sourceExperience,
369
+ });
370
+ break;
371
+ }
372
+ case 'skill_search': {
373
+ const query = validateString(args['query'], 'query');
374
+ const limit = args['limit'] ? validateNumber(args['limit'], 'limit', 1, 50) : 5;
375
+ result = skillsService.search(query, limit);
376
+ break;
377
+ }
378
+ case 'brain_analyze_failure': {
379
+ const task = validateString(args['task'], 'task');
380
+ const attemptedChange = args['attemptedChange']
381
+ ? validateString(args['attemptedChange'], 'attemptedChange')
382
+ : 'Task execution';
383
+ const error = validateString(args['error'], 'error');
384
+ const testOutput = args['testOutput']
385
+ ? validateString(args['testOutput'], 'testOutput')
386
+ : undefined;
387
+ const config = loadConfig(root);
388
+ const brainProvider = createBrainProvider({
389
+ enabled: true,
390
+ provider: config.brain?.provider || 'none',
391
+ model: config.brain?.model,
392
+ timeoutMs: config.brain?.timeoutMs,
393
+ endpoint: config.brain?.endpoint,
394
+ });
395
+ result = await brainProvider.analyzeFailure({ task, attemptedChange, error, testOutput });
396
+ break;
397
+ }
398
+ default:
399
+ throw new Error(`Unknown tool: ${name}`);
400
+ }
401
+ return {
402
+ content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
403
+ };
404
+ }
405
+ finally {
406
+ db.close();
407
+ }
408
+ }
409
+ export async function startMcpServer() {
410
+ const server = new Server({
411
+ name: 'centr',
412
+ version: '0.1.0',
413
+ }, {
414
+ capabilities: {
415
+ tools: {},
416
+ },
417
+ });
418
+ server.setRequestHandler(ListToolsRequestSchema, async () => ({
419
+ tools: TOOLS,
420
+ }));
421
+ server.setRequestHandler(CallToolRequestSchema, async (request) => {
422
+ const { name, arguments: args } = request.params;
423
+ try {
424
+ return await handleTool(name, args || {});
425
+ }
426
+ catch (error) {
427
+ const message = error instanceof Error ? error.message : 'Unknown error';
428
+ return {
429
+ content: [{ type: 'text', text: JSON.stringify({ error: message }) }],
430
+ isError: true,
431
+ };
432
+ }
433
+ });
434
+ const transport = new StdioServerTransport();
435
+ await server.connect(transport);
436
+ }
437
+ export { TOOLS, handleTool };
438
+ // Start server when run directly as CLI entry
439
+ if (process.argv[1] && fileURLToPath(import.meta.url) === process.argv[1]) {
440
+ startMcpServer().catch((error) => {
441
+ console.error('Failed to start MCP server:', error);
442
+ process.exit(1);
443
+ });
444
+ }
445
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EACL,SAAS,EACT,aAAa,EACb,aAAa,EACb,eAAe,EACf,YAAY,EACZ,aAAa,EACb,UAAU,GACX,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,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AI,EAAE,CAAC,CAAC;QAC3D,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;YACzE,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;gBACrE,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC;AAED,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AAE7B,8CAA8C;AAC9C,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1E,cAAc,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QAC/B,OAAO,CAAC,KAAK,CAAC,6BAA6B,EAAE,KAAK,CAAC,CAAC;QACpD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
package/package.json ADDED
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "@centr-ai/mcp",
3
+ "version": "0.1.0",
4
+ "description": "Model Context Protocol (MCP) server for CentR project intelligence",
5
+ "type": "module",
6
+ "bin": {
7
+ "centr-mcp": "./dist/index.js"
8
+ },
9
+ "main": "./dist/index.js",
10
+ "types": "./dist/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.ts",
14
+ "import": "./dist/index.js"
15
+ }
16
+ },
17
+ "engines": {
18
+ "node": ">=20"
19
+ },
20
+ "scripts": {
21
+ "build": "tsc -b",
22
+ "clean": "rm -rf dist tsconfig.tsbuildinfo",
23
+ "typecheck": "tsc --noEmit",
24
+ "test": "vitest run"
25
+ },
26
+ "license": "MIT",
27
+ "author": "CentR Contributors",
28
+ "homepage": "https://chiragpgauswami.github.io/CentR/",
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "git+https://github.com/chiragpgauswami/CentR.git",
32
+ "directory": "packages/mcp"
33
+ },
34
+ "bugs": {
35
+ "url": "https://github.com/chiragpgauswami/CentR/issues"
36
+ },
37
+ "keywords": [
38
+ "centr",
39
+ "mcp",
40
+ "model-context-protocol",
41
+ "claude-code",
42
+ "cursor",
43
+ "codex",
44
+ "ai-agents"
45
+ ],
46
+ "publishConfig": {
47
+ "access": "public"
48
+ },
49
+ "files": [
50
+ "dist",
51
+ "README.md",
52
+ "LICENSE",
53
+ "CHANGELOG.md"
54
+ ],
55
+ "dependencies": {
56
+ "@centr-ai/brain": "0.1.0",
57
+ "@centr-ai/core": "0.1.0",
58
+ "@modelcontextprotocol/sdk": "^1.30.0"
59
+ }
60
+ }