atabey-mcp 0.0.11 → 0.0.13

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.
Files changed (75) hide show
  1. package/README.md +339 -25
  2. package/dist/dashboard/assets/index-BAPGLiWE.js +267 -0
  3. package/dist/dashboard/index.html +15 -0
  4. package/dist/framework-mcp/src/constants.js +64 -0
  5. package/dist/framework-mcp/src/index.js +156 -0
  6. package/dist/framework-mcp/src/resources/index.js +58 -0
  7. package/dist/framework-mcp/src/tools/control_plane/locking.js +84 -0
  8. package/dist/framework-mcp/src/tools/control_plane/registry.js +35 -0
  9. package/dist/framework-mcp/src/tools/definitions.js +197 -0
  10. package/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.js +64 -0
  11. package/dist/framework-mcp/src/tools/file_system/patch_file.js +34 -0
  12. package/dist/framework-mcp/src/tools/file_system/read_file.js +51 -0
  13. package/dist/framework-mcp/src/tools/file_system/replace_text.js +50 -0
  14. package/dist/framework-mcp/src/tools/file_system/write_file.js +55 -0
  15. package/dist/framework-mcp/src/tools/framework/audit_deps.js +41 -0
  16. package/dist/framework-mcp/src/tools/framework/get_status.js +5 -0
  17. package/dist/framework-mcp/src/tools/framework/orchestrate.js +5 -0
  18. package/dist/framework-mcp/src/tools/framework/run_tests.js +27 -0
  19. package/dist/framework-mcp/src/tools/framework/submit_plan.js +13 -0
  20. package/dist/framework-mcp/src/tools/framework/update_contract_hash.js +5 -0
  21. package/dist/framework-mcp/src/tools/framework/update_memory.js +8 -0
  22. package/dist/framework-mcp/src/tools/gateway/llm_gateway_query.js +137 -0
  23. package/dist/framework-mcp/src/tools/gateway/llm_gateway_status.js +90 -0
  24. package/dist/framework-mcp/src/tools/index.js +126 -0
  25. package/dist/framework-mcp/src/tools/memory/delete_knowledge.js +28 -0
  26. package/dist/framework-mcp/src/tools/memory/get_insights.js +22 -0
  27. package/dist/framework-mcp/src/tools/memory/read_memory.js +28 -0
  28. package/dist/framework-mcp/src/tools/memory/search_knowledge.js +48 -0
  29. package/dist/framework-mcp/src/tools/memory/store_knowledge.js +30 -0
  30. package/dist/framework-mcp/src/tools/messaging/ask_human.js +30 -0
  31. package/dist/framework-mcp/src/tools/messaging/log_action.js +22 -0
  32. package/dist/framework-mcp/src/tools/messaging/send_message.js +94 -0
  33. package/dist/framework-mcp/src/tools/observability/check_ports.js +26 -0
  34. package/dist/framework-mcp/src/tools/observability/get_health.js +19 -0
  35. package/dist/framework-mcp/src/tools/quality/analyze_code_quality.js +165 -0
  36. package/dist/framework-mcp/src/tools/quality/check_architecture_compliance.js +134 -0
  37. package/dist/framework-mcp/src/tools/quality/check_lint.js +30 -0
  38. package/dist/framework-mcp/src/tools/schemas.js +182 -0
  39. package/dist/framework-mcp/src/tools/search/get_gaps.js +48 -0
  40. package/dist/framework-mcp/src/tools/search/get_map.js +43 -0
  41. package/dist/framework-mcp/src/tools/search/grep_search.js +78 -0
  42. package/dist/framework-mcp/src/tools/search/list_dir.js +28 -0
  43. package/dist/framework-mcp/src/tools/shell/run_command.js +121 -0
  44. package/dist/framework-mcp/src/tools/types.js +1 -0
  45. package/dist/framework-mcp/src/utils/cli.js +59 -0
  46. package/dist/framework-mcp/src/utils/compliance.js +292 -0
  47. package/dist/framework-mcp/src/utils/errors.js +68 -0
  48. package/dist/framework-mcp/src/utils/fs.js +47 -0
  49. package/dist/framework-mcp/src/utils/memory.js +74 -0
  50. package/dist/framework-mcp/src/utils/metrics.js +56 -0
  51. package/dist/framework-mcp/src/utils/permissions.js +71 -0
  52. package/dist/framework-mcp/src/utils/security.js +60 -0
  53. package/dist/framework-mcp/src/utils/storage.js +207 -0
  54. package/dist/framework-mcp/src/utils/types.js +16 -0
  55. package/dist/framework-mcp/src/utils/zod-to-mcp.js +79 -0
  56. package/dist/index.js +14 -2
  57. package/dist/src/cli/utils/memory.js +279 -0
  58. package/dist/src/cli/utils/time.js +27 -0
  59. package/dist/src/cli/utils/ui.js +100 -0
  60. package/dist/src/modules/memory/core.js +99 -0
  61. package/dist/src/modules/memory/embedding.js +130 -0
  62. package/dist/src/modules/memory/types.js +1 -0
  63. package/dist/src/modules/memory/vector-store.js +74 -0
  64. package/dist/src/shared/constants.js +187 -0
  65. package/dist/src/shared/fs.js +53 -0
  66. package/dist/src/shared/logger.js +126 -0
  67. package/dist/src/shared/pii.js +121 -0
  68. package/dist/src/shared/storage.js +211 -0
  69. package/dist/src/shared/types.js +16 -0
  70. package/dist/tools/definitions.js +79 -247
  71. package/dist/tools/index.js +37 -0
  72. package/dist/tools/schemas.js +133 -0
  73. package/dist/utils/types.js +4 -0
  74. package/dist/utils/zod-to-mcp.js +77 -0
  75. package/package.json +2 -2
package/README.md CHANGED
@@ -1,48 +1,362 @@
1
1
  # Agent Atabey — MCP Server (`atabey-mcp`)
2
2
 
3
- [![Version](https://img.shields.io/npm/v/atabey-mcp.svg)](https://npmjs.com/package/atabey-mcp)
3
+ [![Version](https://img.shields.io/npm/v/atabey-mcp.svg)](https://www.npmjs.com/package/atabey-mcp)
4
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+ [![npm](https://img.shields.io/npm/dt/atabey-mcp)](https://www.npmjs.com/package/atabey-mcp)
5
6
 
6
- The **Model Context Protocol (MCP)** server for [Agent Atabey](https://npmjs.com/package/atabey).
7
+ The **Model Context Protocol (MCP)** server for [Agent Atabey](https://www.npmjs.com/package/atabey).
7
8
 
8
- This package acts as the bridge between AI Assistants (like Claude Desktop, Cursor, or Antigravity CLI) and your local project environment. It provides a highly governed, type-safe set of tools that allow AI agents to interact with your codebase securely.
9
+ This package bridges AI assistants (Claude Code, Gemini CLI, Cursor, Codex, Antigravity) with your local project environment. Provides **30+ secure, audited, type-safe tools** across 10 categories. Includes the **Hermes Control Center** dashboard with 8 live modules.
9
10
 
10
- ## 🚀 Features
11
+ > **Main Package:** [`atabey`](https://www.npmjs.com/package/atabey) (CLI + Framework)
11
12
 
12
- - **Strict Governance:** Enforces Zero Type Hole and Zero Console policies via AST parsing.
13
- - **Surgical Edits:** Uses `patch_file` and `replace_text` instead of full-file rewrites to save tokens and prevent context loss.
14
- - **Hermes Message Broker:** Facilitates asynchronous communication between specialized agents (`@manager`, `@architect`, `@security`, etc.).
15
- - **Memory Insights:** Provides agents with targeted, pruned context (last 5 actions, active trace) instead of dumping the entire project history.
16
- - **Risk Engine:** Automatically blocks or requires human approval for high-risk operations (e.g., deleting databases, touching `.env` files).
13
+ ---
14
+
15
+ ## 📋 Table of Contents
16
+
17
+ - [Installation](#installation)
18
+ - [How It Works](#how-it-works)
19
+ - [Hermes Control Center Dashboard](#hermes-control-center-dashboard)
20
+ - [Provided Tools (30+)](#provided-tools-30)
21
+ - [MCP Configuration](#mcp-configuration)
22
+ - [Development](#development)
23
+ - [Testing](#testing)
17
24
 
18
- ## 📦 Installation
25
+ ---
19
26
 
20
- Typically, you do not need to install this package manually. It is automatically installed and configured when you initialize an Atabey project:
27
+ ## Installation
21
28
 
22
29
  ```bash
23
- npx atabey init
30
+ # Run with npx (no install needed)
31
+ npx atabey-mcp
32
+
33
+ # Global install
34
+ npm install -g atabey-mcp
35
+
36
+ # Add to project
37
+ npm install atabey-mcp
38
+ ```
39
+
40
+ ---
41
+
42
+ ## How It Works
43
+
44
+ Atabey MCP Server connects your AI assistant to your project via the **Model Context Protocol**:
45
+
46
+ ```
47
+ AI Assistant (Claude/Gemini/Cursor)
48
+
49
+ ▼ MCP Protocol (stdio transport)
50
+
51
+ Atabey MCP Server (30+ tools)
52
+
53
+
54
+ Your Project (files, database, git, shell)
24
55
  ```
25
56
 
26
- However, you can install it globally or locally if needed:
57
+ When you type `@backend Create login API` in your AI chat:
58
+ 1. The AI calls `send_agent_message` tool via MCP
59
+ 2. Atabey routes it through `RoutingEngine`
60
+ 3. The `@backend` agent executes the task
61
+ 4. `QualityGate` validates the output
62
+ 5. Result is stored in `Vector Memory`
63
+
64
+ **No separate terminal needed. No CLI commands for daily use.**
65
+
66
+ ---
67
+
68
+ ## Hermes Control Center Dashboard
69
+
70
+ The MCP package includes a real-time WebSocket dashboard with 8 live modules:
71
+
72
+ | Module | Description | Update |
73
+ |--------|-------------|--------|
74
+ | 🤖 **Agent Monitor** | 13 AI agent status + live tasks | WS (5s) |
75
+ | 📨 **Hermes Messages** | Agent message queue + filtering | WS (5s) |
76
+ | 🔐 **Approval Center** | Human-in-the-Loop approvals | WS |
77
+ | 📋 **Task Planner** | Task DAG + progress tracking | REST (5s) |
78
+ | 📝 **Agent Logs** | Execution logs + agent filter | WS (5s) |
79
+ | ⚠️ **Error Tracker** | Lint/compliance/security errors | WS |
80
+ | 🧠 **Memory Insights** | Vector memory search | REST |
81
+ | 🛡️ **Compliance** | Quality gate violations | REST (15s) |
27
82
 
28
83
  ```bash
29
- npm install atabey-mcp
84
+ # Start dashboard (default port: 5858)
85
+ npx atabey dashboard
86
+ # Browser: http://localhost:5858
87
+ ```
88
+
89
+ ### Dashboard Components
90
+
30
91
  ```
92
+ framework-mcp/dashboard/src/
93
+ ├── App.tsx # Main app, routing and WS management
94
+ ├── main.tsx # React entry point
95
+ ├── styles.ts # PandaCSS styles
96
+ ├── components/
97
+ │ ├── AdapterSkillsPanel.tsx # Adapter skill mapping
98
+ │ ├── AgentMonitor.tsx # Agent status monitoring
99
+ │ ├── ApprovalCenter.tsx # Approval center
100
+ │ ├── CompliancePanel.tsx # Compliance control panel
101
+ │ ├── ErrorTracker.tsx # Error tracking
102
+ │ ├── GatewayPanel.tsx # LLM Gateway management
103
+ │ ├── HermesBrokerView.tsx # Hermes message queue
104
+ │ ├── HermesStats.tsx # Hermes statistics
105
+ │ ├── LogViewer.tsx # Log viewer
106
+ │ ├── MemoryInsights.tsx # Memory insights
107
+ │ ├── PlanViewer.tsx # Plan viewer
108
+ │ └── QualityPanel.tsx # Quality panel
109
+ └── hooks/
110
+ ├── useApi.ts # REST API hook
111
+ └── useWS.ts # WebSocket hook
112
+ ```
113
+
114
+ ---
115
+
116
+ ## Provided Tools (30+)
117
+
118
+ ### File System
119
+
120
+ | Tool | Description | Zod Validation |
121
+ |------|-------------|----------------|
122
+ | `read_file` | Read file content with line range | ✅ |
123
+ | `write_file` | Atomic file write with directory creation | ✅ |
124
+ | `replace_text` | Surgical text replacement | ✅ |
125
+ | `patch_file` | Safe line-range update | ✅ |
126
+ | `batch_surgical_edit` | Multi-file batch editing | ✅ |
127
+
128
+ ### Search & Exploration
129
+
130
+ | Tool | Description |
131
+ |------|-------------|
132
+ | `list_dir` | List directory contents |
133
+ | `grep_search` | Recursive regex search |
134
+ | `get_project_map` | Project structure tree |
135
+ | `get_project_gaps` | Find TODOs, FIXMEs, gaps |
136
+
137
+ ### Control Plane
138
+
139
+ | Tool | Description |
140
+ |------|-------------|
141
+ | `acquire_lock` | Acquire resource lock |
142
+ | `release_lock` | Release resource lock |
143
+ | `register_agent` | Register agent instance |
144
+
145
+ ### Messaging (Hermes Protocol)
146
+
147
+ | Tool | Description |
148
+ |------|-------------|
149
+ | `send_agent_message` | Hermes protocol messaging |
150
+ | `log_agent_action` | Log agent actions |
151
+ | `ask_human` | Wait for human input |
31
152
 
32
- ## 🛠️ Provided Tools
153
+ ### Memory
33
154
 
34
- The `atabey-mcp` server exposes over 25 specialized tools grouped into the following domains:
155
+ | Tool | Description |
156
+ |------|-------------|
157
+ | `read_project_memory` | Read central memory |
158
+ | `update_project_memory` | Update memory section |
159
+ | `get_memory_insights` | Memory summaries |
160
+ | `store_knowledge` | Store vector knowledge |
161
+ | `search_knowledge` | Search vector memory |
162
+ | `delete_knowledge` | Delete knowledge entry |
35
163
 
36
- - **File System:** `read_file`, `write_file`, `replace_text`, `patch_file`, `batch_surgical_edit`
37
- - **Control Plane:** `acquire_lock`, `release_lock`, `register_agent`
38
- - **Framework & Orchestration:** `submit_plan`, `orchestrate_loop`, `update_project_memory`, `audit_dependencies`
39
- - **Search & Map:** `grep_search`, `list_dir`, `get_architectural_map`, `get_knowledge_gaps`
40
- - **Quality & Observability:** `check_lint`, `run_tests`, `get_system_health`, `check_ports`
41
- - **Messaging:** `send_agent_message`, `log_agent_action`
164
+ ### Framework & Quality
42
165
 
43
- ## 📖 Learn More
166
+ | Tool | Description |
167
+ |------|-------------|
168
+ | `get_framework_status` | Framework status |
169
+ | `run_tests` | Run test suites |
170
+ | `check_lint` | Run ESLint |
171
+ | `update_contract_hash` | Sync contract hash |
172
+ | `orchestrate_loop` | Process Hermes messages |
173
+ | `submit_plan` | Submit DAG task plan |
174
+ | `audit_dependencies` | Audit package.json |
175
+ | `get_system_health` | CPU/RAM metrics |
176
+ | `check_active_ports` | Port monitoring |
44
177
 
45
- For full documentation, architecture details, and enterprise inquiries, please visit the main [Agent Atabey Repository](https://github.com/ysf-bkr/atabey).
178
+ ### Quality
179
+
180
+ | Tool | Description |
181
+ |------|-------------|
182
+ | `analyze_code_quality` | Code quality analysis |
183
+ | `check_architecture_compliance` | Architecture compliance check |
184
+ | `check_lint` | ESLint validation |
185
+
186
+ ### Observability
187
+
188
+ | Tool | Description |
189
+ |------|-------------|
190
+ | `get_health` | System health |
191
+ | `check_ports` | Port status |
192
+
193
+ ### Shell
194
+
195
+ | Tool | Description |
196
+ |------|-------------|
197
+ | `run_shell_command` | Execute shell commands |
46
198
 
47
199
  ---
48
- *Developed by Yusuf BEKAR*
200
+
201
+ ## LLM Gateway Tools
202
+
203
+ ### `llm_gateway_query`
204
+
205
+ Sends queries to LLM providers with load balancing, circuit breaker, and rate limiting.
206
+
207
+ **Parameters:**
208
+ - `provider` (string): LLM provider name (`openai`, `anthropic`, `google`, `groq`, `ollama`)
209
+ - `model` (string): Model name
210
+ - `messages` (array): Chat messages
211
+ - `options` (object, optional): Temperature, max tokens, etc.
212
+
213
+ ### `llm_gateway_status`
214
+
215
+ Returns gateway status and provider statistics.
216
+
217
+ **Supported Providers:**
218
+
219
+ | Provider | Models | Status |
220
+ |----------|--------|--------|
221
+ | OpenAI | GPT-4, GPT-4o, o3, o4-mini | ✅ |
222
+ | Anthropic | Claude Opus 4.5, Sonnet 4.5, Haiku 3.5 | ✅ |
223
+ | Google | Gemini 2.5 Pro, Flash, Flash-Lite | ✅ |
224
+ | Groq | Llama, Mixtral | ✅ |
225
+ | Ollama | Local models | ✅ |
226
+
227
+ ---
228
+
229
+ ## MCP Configuration
230
+
231
+ ### Claude Code
232
+
233
+ Add to your `mcp.json`:
234
+
235
+ ```json
236
+ {
237
+ "mcpServers": {
238
+ "atabey": {
239
+ "command": "npx",
240
+ "args": ["atabey-mcp"],
241
+ "env": {
242
+ "ATABEY_PROJECT_ROOT": "/path/to/your/project"
243
+ }
244
+ }
245
+ }
246
+ }
247
+ ```
248
+
249
+ ### Environment Variables
250
+
251
+ | Variable | Description | Default |
252
+ |----------|-------------|---------|
253
+ | `ATABEY_PROJECT_ROOT` | Project root directory | `process.cwd()` |
254
+ | `PORT` or `DASHBOARD_PORT` | Dashboard port | `5858` |
255
+ | `NODE_ENV` | Environment (production/development) | `development` |
256
+
257
+ ### Gemini CLI
258
+
259
+ ```bash
260
+ gemini config set mcpServers.atabey.command "npx"
261
+ gemini config set mcpServers.atabey.args "[\"atabey-mcp\"]"
262
+ ```
263
+
264
+ ### Cursor
265
+
266
+ ```json
267
+ // .cursor/mcp.json
268
+ {
269
+ "mcpServers": {
270
+ "atabey": {
271
+ "command": "npx",
272
+ "args": ["atabey-mcp"]
273
+ }
274
+ }
275
+ }
276
+ ```
277
+
278
+ ---
279
+
280
+ ## Development
281
+
282
+ ```bash
283
+ # Install dependencies
284
+ npm install
285
+
286
+ # Build
287
+ npm run build
288
+
289
+ # Build dashboard
290
+ npm run build --prefix dashboard
291
+
292
+ # Development mode
293
+ npm run dev
294
+ ```
295
+
296
+ ### Project Structure
297
+
298
+ ```
299
+ framework-mcp/
300
+ ├── src/
301
+ │ ├── index.ts # MCP Server (Stdio Transport)
302
+ │ ├── constants.ts # MCP-specific constants
303
+ │ ├── declarations.d.ts # Type declarations
304
+ │ ├── resources/ # MCP Resources
305
+ │ ├── tools/
306
+ │ │ ├── definitions.ts # Tool definitions
307
+ │ │ ├── index.ts # Tool handlers
308
+ │ │ ├── schemas.ts # Zod validation schemas
309
+ │ │ ├── types.ts # Tool types
310
+ │ │ ├── control_plane/ # Lock, Registry
311
+ │ │ ├── file_system/ # Read, Write, Edit, Patch
312
+ │ │ ├── framework/ # Status, Test, Orchestrate
313
+ │ │ ├── gateway/ # LLM Gateway
314
+ │ │ ├── memory/ # Knowledge management
315
+ │ │ ├── messaging/ # Hermes messaging
316
+ │ │ ├── observability/ # Health, Port
317
+ │ │ ├── quality/ # Code quality
318
+ │ │ ├── search/ # Grep, Map, Gap
319
+ │ │ └── shell/ # Command execution
320
+ │ └── utils/ # Utilities
321
+ ├── dashboard/ # React Dashboard
322
+ └── tests/ # Tests
323
+ ```
324
+
325
+ ---
326
+
327
+ ## Testing
328
+
329
+ ```bash
330
+ # Run all tests
331
+ npm test
332
+
333
+ # Run specific test
334
+ npx vitest run tests/tools/file_system/file_system_tools.test.ts
335
+ ```
336
+
337
+ ### Current Test Files
338
+
339
+ | Test File | Scope |
340
+ |-----------|-------|
341
+ | `file_system/file_system_tools.test.ts` | Basic file system tools |
342
+ | `file_system/compliance-risk.test.ts` | Compliance risk analysis |
343
+ | `file_system/permissions.test.ts` | Permission controls |
344
+ | `messaging/send_message.test.ts` | Hermes messaging |
345
+ | `quality/check_lint.test.ts` | ESLint validation |
346
+ | `shell/run_command.test.ts` | Shell commands |
347
+
348
+ > **Note:** Gateway module tests are in the main package: `tests/modules/gateway/`
349
+
350
+ ---
351
+
352
+ ## More Information
353
+
354
+ - **Main Package:** [`atabey`](https://www.npmjs.com/package/atabey) (CLI + Framework)
355
+ - **GitHub:** [github.com/ysf-bkr/atabey](https://github.com/ysf-bkr/atabey)
356
+ - **Documentation:** [ARCHITECTURE.md](../ARCHITECTURE.md)
357
+ - **Contributing:** [CONTRIBUTING.md](../CONTRIBUTING.md)
358
+ - **Enterprise:** ybekar@msn.com
359
+
360
+ ---
361
+
362
+ *Developer: **Yusuf BEKAR** — "Order from Chaos"*