quantix-mcp 0.5.0 → 0.5.3
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 +12 -1
- package/dist/tools/subscriptions.d.ts.map +1 -1
- package/dist/tools/subscriptions.js +46 -1
- package/dist/tools/subscriptions.js.map +1 -1
- package/dist/tools/transactions.d.ts.map +1 -1
- package/dist/tools/transactions.js +5 -5
- package/dist/tools/transactions.js.map +1 -1
- package/dist/types/schemas.d.ts +17 -0
- package/dist/types/schemas.d.ts.map +1 -1
- package/dist/types/schemas.js +21 -4
- package/dist/types/schemas.js.map +1 -1
- package/package.json +9 -4
- package/.claude/commands/opsx/apply.md +0 -152
- package/.claude/commands/opsx/archive.md +0 -157
- package/.claude/commands/opsx/bulk-archive.md +0 -242
- package/.claude/commands/opsx/continue.md +0 -114
- package/.claude/commands/opsx/explore.md +0 -174
- package/.claude/commands/opsx/ff.md +0 -94
- package/.claude/commands/opsx/new.md +0 -69
- package/.claude/commands/opsx/onboard.md +0 -525
- package/.claude/commands/opsx/sync.md +0 -134
- package/.claude/commands/opsx/verify.md +0 -164
- package/.claude/settings.local.json +0 -9
- package/.claude/skills/openspec-apply-change/SKILL.md +0 -156
- package/.claude/skills/openspec-archive-change/SKILL.md +0 -114
- package/.claude/skills/openspec-bulk-archive-change/SKILL.md +0 -246
- package/.claude/skills/openspec-continue-change/SKILL.md +0 -118
- package/.claude/skills/openspec-explore/SKILL.md +0 -290
- package/.claude/skills/openspec-ff-change/SKILL.md +0 -101
- package/.claude/skills/openspec-new-change/SKILL.md +0 -74
- package/.claude/skills/openspec-onboard/SKILL.md +0 -529
- package/.claude/skills/openspec-sync-specs/SKILL.md +0 -138
- package/.claude/skills/openspec-verify-change/SKILL.md +0 -168
- package/.dockerignore +0 -8
- package/.gemini/commands/opsx/apply.toml +0 -149
- package/.gemini/commands/opsx/archive.toml +0 -154
- package/.gemini/commands/opsx/bulk-archive.toml +0 -239
- package/.gemini/commands/opsx/continue.toml +0 -111
- package/.gemini/commands/opsx/explore.toml +0 -171
- package/.gemini/commands/opsx/ff.toml +0 -91
- package/.gemini/commands/opsx/new.toml +0 -66
- package/.gemini/commands/opsx/onboard.toml +0 -522
- package/.gemini/commands/opsx/sync.toml +0 -131
- package/.gemini/commands/opsx/verify.toml +0 -161
- package/.gemini/skills/openspec-apply-change/SKILL.md +0 -156
- package/.gemini/skills/openspec-archive-change/SKILL.md +0 -114
- package/.gemini/skills/openspec-bulk-archive-change/SKILL.md +0 -246
- package/.gemini/skills/openspec-continue-change/SKILL.md +0 -118
- package/.gemini/skills/openspec-explore/SKILL.md +0 -290
- package/.gemini/skills/openspec-ff-change/SKILL.md +0 -101
- package/.gemini/skills/openspec-new-change/SKILL.md +0 -74
- package/.gemini/skills/openspec-onboard/SKILL.md +0 -529
- package/.gemini/skills/openspec-sync-specs/SKILL.md +0 -138
- package/.gemini/skills/openspec-verify-change/SKILL.md +0 -168
- package/.github/agents/copilot-instructions.md +0 -32
- package/.github/agents/speckit.analyze.agent.md +0 -184
- package/.github/agents/speckit.checklist.agent.md +0 -294
- package/.github/agents/speckit.clarify.agent.md +0 -181
- package/.github/agents/speckit.constitution.agent.md +0 -82
- package/.github/agents/speckit.implement.agent.md +0 -135
- package/.github/agents/speckit.plan.agent.md +0 -89
- package/.github/agents/speckit.specify.agent.md +0 -258
- package/.github/agents/speckit.tasks.agent.md +0 -137
- package/.github/agents/speckit.taskstoissues.agent.md +0 -30
- package/.github/copilot-instructions.md +0 -17
- package/.github/prompts/speckit.analyze.prompt.md +0 -3
- package/.github/prompts/speckit.checklist.prompt.md +0 -3
- package/.github/prompts/speckit.clarify.prompt.md +0 -3
- package/.github/prompts/speckit.constitution.prompt.md +0 -3
- package/.github/prompts/speckit.implement.prompt.md +0 -3
- package/.github/prompts/speckit.plan.prompt.md +0 -3
- package/.github/prompts/speckit.specify.prompt.md +0 -3
- package/.github/prompts/speckit.tasks.prompt.md +0 -3
- package/.github/prompts/speckit.taskstoissues.prompt.md +0 -3
- package/.github/workflows/publish.yaml +0 -29
- package/.opencode/command/speckit.analyze.md +0 -184
- package/.opencode/command/speckit.checklist.md +0 -294
- package/.opencode/command/speckit.clarify.md +0 -181
- package/.opencode/command/speckit.constitution.md +0 -84
- package/.opencode/command/speckit.implement.md +0 -135
- package/.opencode/command/speckit.plan.md +0 -89
- package/.opencode/command/speckit.specify.md +0 -258
- package/.opencode/command/speckit.tasks.md +0 -137
- package/.opencode/command/speckit.taskstoissues.md +0 -30
- package/.qwen/commands/opsx-apply.toml +0 -149
- package/.qwen/commands/opsx-archive.toml +0 -154
- package/.qwen/commands/opsx-bulk-archive.toml +0 -239
- package/.qwen/commands/opsx-continue.toml +0 -111
- package/.qwen/commands/opsx-explore.toml +0 -171
- package/.qwen/commands/opsx-ff.toml +0 -91
- package/.qwen/commands/opsx-new.toml +0 -66
- package/.qwen/commands/opsx-onboard.toml +0 -522
- package/.qwen/commands/opsx-sync.toml +0 -131
- package/.qwen/commands/opsx-verify.toml +0 -161
- package/.qwen/skills/openspec-apply-change/SKILL.md +0 -156
- package/.qwen/skills/openspec-archive-change/SKILL.md +0 -114
- package/.qwen/skills/openspec-bulk-archive-change/SKILL.md +0 -246
- package/.qwen/skills/openspec-continue-change/SKILL.md +0 -118
- package/.qwen/skills/openspec-explore/SKILL.md +0 -290
- package/.qwen/skills/openspec-ff-change/SKILL.md +0 -101
- package/.qwen/skills/openspec-new-change/SKILL.md +0 -74
- package/.qwen/skills/openspec-onboard/SKILL.md +0 -529
- package/.qwen/skills/openspec-sync-specs/SKILL.md +0 -138
- package/.qwen/skills/openspec-verify-change/SKILL.md +0 -168
- package/.specify/memory/constitution.md +0 -58
- package/.specify/scripts/powershell/check-prerequisites.ps1 +0 -148
- package/.specify/scripts/powershell/common.ps1 +0 -137
- package/.specify/scripts/powershell/create-new-feature.ps1 +0 -283
- package/.specify/scripts/powershell/setup-plan.ps1 +0 -61
- package/.specify/scripts/powershell/update-agent-context.ps1 +0 -448
- package/.specify/templates/agent-file-template.md +0 -28
- package/.specify/templates/checklist-template.md +0 -40
- package/.specify/templates/constitution-template.md +0 -50
- package/.specify/templates/plan-template.md +0 -104
- package/.specify/templates/spec-template.md +0 -115
- package/.specify/templates/tasks-template.md +0 -251
- package/.vscode/launch.json +0 -14
- package/.vscode/settings.json +0 -14
- package/.vscode/tasks.json +0 -15
- package/AGENTS.md +0 -117
- package/CLAUDE.md +0 -70
- package/Dockerfile +0 -30
- package/GEMINI.md +0 -117
- package/QWEN.md +0 -117
- package/docker-compose.yml +0 -17
- package/openapi.yaml +0 -3127
- package/openspec/README.md +0 -33
- package/openspec/changes/archive/2026-04-03-separate-credit-card-transaction-tools/.openspec.yaml +0 -2
- package/openspec/changes/archive/2026-04-03-separate-credit-card-transaction-tools/design.md +0 -60
- package/openspec/changes/archive/2026-04-03-separate-credit-card-transaction-tools/proposal.md +0 -25
- package/openspec/changes/archive/2026-04-03-separate-credit-card-transaction-tools/specs/credit-card-transactions/spec.md +0 -46
- package/openspec/changes/archive/2026-04-03-separate-credit-card-transaction-tools/specs/transactions/spec.md +0 -42
- package/openspec/changes/archive/2026-04-03-separate-credit-card-transaction-tools/tasks.md +0 -22
- package/openspec/config.yaml +0 -20
- package/openspec/specs/accounts/spec.md +0 -86
- package/openspec/specs/categories/spec.md +0 -78
- package/openspec/specs/credit-card-transactions/spec.md +0 -64
- package/openspec/specs/credit-cards/spec.md +0 -109
- package/openspec/specs/data/spec.md +0 -49
- package/openspec/specs/settings/spec.md +0 -48
- package/openspec/specs/subscriptions/spec.md +0 -85
- package/openspec/specs/summary/spec.md +0 -49
- package/openspec/specs/transactions/spec.md +0 -113
- package/openspec/specs/transfers/spec.md +0 -74
- package/specs/001-mcp-api-integration/checklists/requirements.md +0 -34
- package/specs/001-mcp-api-integration/contracts/openapi.yaml +0 -636
- package/specs/001-mcp-api-integration/data-model.md +0 -106
- package/specs/001-mcp-api-integration/plan.md +0 -73
- package/specs/001-mcp-api-integration/quickstart.md +0 -74
- package/specs/001-mcp-api-integration/research.md +0 -58
- package/specs/001-mcp-api-integration/spec.md +0 -119
- package/specs/001-mcp-api-integration/tasks.md +0 -64
- package/src/config.ts +0 -39
- package/src/index.ts +0 -116
- package/src/services/apiClient.ts +0 -55
- package/src/services/requestContext.ts +0 -11
- package/src/tools/accounts.ts +0 -122
- package/src/tools/categories.ts +0 -102
- package/src/tools/credit-cards.ts +0 -203
- package/src/tools/data.ts +0 -45
- package/src/tools/settings.ts +0 -64
- package/src/tools/subscriptions.ts +0 -159
- package/src/tools/summary.ts +0 -29
- package/src/tools/transactions.ts +0 -200
- package/src/tools/transfers.ts +0 -122
- package/src/types/schemas.ts +0 -333
- package/src/utils/toolHelpers.ts +0 -11
- package/tests/benchmark.test.d.ts +0 -2
- package/tests/benchmark.test.d.ts.map +0 -1
- package/tests/benchmark.test.js +0 -33
- package/tests/benchmark.test.js.map +0 -1
- package/tests/benchmark.test.ts +0 -38
- package/tests/server.test.d.ts +0 -2
- package/tests/server.test.d.ts.map +0 -1
- package/tests/server.test.js +0 -13
- package/tests/server.test.js.map +0 -1
- package/tests/server.test.ts +0 -14
- package/tests/setup.d.ts +0 -4
- package/tests/setup.d.ts.map +0 -1
- package/tests/setup.js +0 -17
- package/tests/setup.js.map +0 -1
- package/tests/setup.ts +0 -20
- package/tests/tools/accounts.test.ts +0 -159
- package/tests/tools/categories.test.d.ts +0 -2
- package/tests/tools/categories.test.d.ts.map +0 -1
- package/tests/tools/categories.test.js +0 -63
- package/tests/tools/categories.test.js.map +0 -1
- package/tests/tools/categories.test.ts +0 -120
- package/tests/tools/credit-cards.test.d.ts +0 -2
- package/tests/tools/credit-cards.test.d.ts.map +0 -1
- package/tests/tools/credit-cards.test.js +0 -71
- package/tests/tools/credit-cards.test.js.map +0 -1
- package/tests/tools/credit-cards.test.ts +0 -131
- package/tests/tools/data.test.ts +0 -100
- package/tests/tools/settings.test.ts +0 -116
- package/tests/tools/subscriptions.test.ts +0 -173
- package/tests/tools/summary.test.d.ts +0 -2
- package/tests/tools/summary.test.d.ts.map +0 -1
- package/tests/tools/summary.test.js +0 -36
- package/tests/tools/summary.test.js.map +0 -1
- package/tests/tools/summary.test.ts +0 -63
- package/tests/tools/transactions.test.d.ts +0 -2
- package/tests/tools/transactions.test.d.ts.map +0 -1
- package/tests/tools/transactions.test.js +0 -67
- package/tests/tools/transactions.test.js.map +0 -1
- package/tests/tools/transactions.test.ts +0 -133
- package/tests/tools/transfers.test.ts +0 -141
- package/tsconfig.json +0 -52
- package/vitest.config.d.ts +0 -3
- package/vitest.config.d.ts.map +0 -1
- package/vitest.config.js +0 -14
- package/vitest.config.js.map +0 -1
- package/vitest.config.ts +0 -14
package/GEMINI.md
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
# Quantix MCP Server Context
|
|
2
|
-
|
|
3
|
-
This project is a [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server that provides a bridge between AI models and the **Quantix Personal Finance API**. It allows AI assistants to manage accounts, transactions, categories, credit cards, and financial summaries.
|
|
4
|
-
|
|
5
|
-
## Project Overview
|
|
6
|
-
|
|
7
|
-
- **Purpose**: Expose Quantix API endpoints as MCP tools for personal finance management.
|
|
8
|
-
- **Authentication**: Uses **API Key authentication** (`x-api-key` header). Although the Quantix API supports JWT/Bearer tokens for web use, they expire every 15 minutes. For persistent MCP access, a long-lived API Key is required.
|
|
9
|
-
- **Architecture**:
|
|
10
|
-
- **Modular Tools**: Tools are categorized by domain (e.g., `accounts.ts`, `transactions.ts`) in `src/tools/`.
|
|
11
|
-
- **Centralized API Client**: `src/services/apiClient.ts` handles communication with the Quantix API using a singleton `apiClient`.
|
|
12
|
-
- **Schema Validation**: Extensive use of [Zod](https://zod.dev/) in `src/types/schemas.ts` to ensure input/output safety and provide descriptive metadata for the AI.
|
|
13
|
-
- **Configuration**: Managed via `dotenv` and validated with Zod in `src/config.ts`.
|
|
14
|
-
- **Key Technologies**: TypeScript, Node.js, @modelcontextprotocol/sdk, Zod, Vitest.
|
|
15
|
-
|
|
16
|
-
## Building and Running
|
|
17
|
-
|
|
18
|
-
### Prerequisites
|
|
19
|
-
- Node.js (v18+)
|
|
20
|
-
- Valid `QUANTIX_API_URL` and `QUANTIX_API_KEY` in a `.env` file.
|
|
21
|
-
|
|
22
|
-
### Commands
|
|
23
|
-
- **Install Dependencies**: `npm install`
|
|
24
|
-
- **Build**: `npm run build` (Compiles TypeScript to `dist/`)
|
|
25
|
-
- **Development**: `npm run dev` (Runs directly from source using `tsx`)
|
|
26
|
-
- **Production**: `npm start` (Runs the compiled `dist/index.js`)
|
|
27
|
-
- **Test**: `npm test` (Runs the test suite using Vitest)
|
|
28
|
-
- **MCP Inspector**: `npx @modelcontextprotocol/inspector node dist/index.js` (Recommended for interactive tool testing)
|
|
29
|
-
|
|
30
|
-
## Development Conventions
|
|
31
|
-
|
|
32
|
-
### Adding New Tools
|
|
33
|
-
1. Define the input/output schemas in `src/types/schemas.ts`.
|
|
34
|
-
2. Create or update the relevant domain file in `src/tools/`.
|
|
35
|
-
3. Use the `registerTool` method on the `McpServer` instance.
|
|
36
|
-
4. Export a registration function (e.g., `registerNewDomainTools`) and call it in `src/index.ts`.
|
|
37
|
-
|
|
38
|
-
### Error Handling
|
|
39
|
-
- Use the `handleToolError` helper from `src/utils/toolHelpers.ts` to provide consistent error messages to the AI.
|
|
40
|
-
- The `apiClient` throws `ApiClientError` for non-2xx responses, which includes the status code and status text.
|
|
41
|
-
|
|
42
|
-
### Tool Guidelines
|
|
43
|
-
- **Descriptions**: Always provide clear, detailed descriptions for tools and their arguments in the Zod schemas (using `.describe()`). This helps the AI understand when and how to use the tool.
|
|
44
|
-
- **Idempotency**: Ensure that "Get" operations are read-only and mutations follow standard REST patterns.
|
|
45
|
-
- **Validation**: Rely on Zod for input validation. If a required field is missing, the MCP SDK will automatically inform the user/AI.
|
|
46
|
-
|
|
47
|
-
### Testing
|
|
48
|
-
- Place tests in the `tests/` directory.
|
|
49
|
-
- Use `tests/setup.ts` to mock the global `fetch` and the project `config`.
|
|
50
|
-
- Aim for high coverage of tool logic by mocking various API responses.
|
|
51
|
-
|
|
52
|
-
## Environment Variables
|
|
53
|
-
| Variable | Description | Default |
|
|
54
|
-
|----------|-------------|---------|
|
|
55
|
-
| `QUANTIX_API_URL` | Base URL for the Quantix API | `https://api.quantix.example.com` |
|
|
56
|
-
| `QUANTIX_API_KEY` | Your secret API Key | (Required) |
|
|
57
|
-
| `MCPPORT` | Port for HTTP transport (if used) | `3001` |
|
|
58
|
-
| `NODE_ENV` | Environment mode | `development` |
|
|
59
|
-
|
|
60
|
-
# context-mode — MANDATORY routing rules
|
|
61
|
-
|
|
62
|
-
You have context-mode MCP tools available. These rules are NOT optional — they protect your context window from flooding. A single unrouted command can dump 56 KB into context and waste the entire session.
|
|
63
|
-
|
|
64
|
-
## BLOCKED commands — do NOT attempt these
|
|
65
|
-
|
|
66
|
-
### curl / wget — BLOCKED
|
|
67
|
-
Any shell command containing `curl` or `wget` will be intercepted and blocked. Do NOT retry.
|
|
68
|
-
Instead use:
|
|
69
|
-
- `mcp__context-mode__ctx_fetch_and_index(url, source)` to fetch and index web pages
|
|
70
|
-
- `mcp__context-mode__ctx_execute(language: "javascript", code: "const r = await fetch(...)")` to run HTTP calls in sandbox
|
|
71
|
-
|
|
72
|
-
### Inline HTTP — BLOCKED
|
|
73
|
-
Any shell command containing `fetch('http`, `requests.get(`, `requests.post(`, `http.get(`, or `http.request(` will be intercepted and blocked. Do NOT retry with shell.
|
|
74
|
-
Instead use:
|
|
75
|
-
- `mcp__context-mode__ctx_execute(language, code)` to run HTTP calls in sandbox — only stdout enters context
|
|
76
|
-
|
|
77
|
-
### WebFetch / web browsing — BLOCKED
|
|
78
|
-
Direct web fetching is blocked. Use the sandbox equivalent.
|
|
79
|
-
Instead use:
|
|
80
|
-
- `mcp__context-mode__ctx_fetch_and_index(url, source)` then `mcp__context-mode__ctx_search(queries)` to query the indexed content
|
|
81
|
-
|
|
82
|
-
## REDIRECTED tools — use sandbox equivalents
|
|
83
|
-
|
|
84
|
-
### Shell (>20 lines output)
|
|
85
|
-
Shell is ONLY for: `git`, `mkdir`, `rm`, `mv`, `cd`, `ls`, `npm install`, `pip install`, and other short-output commands.
|
|
86
|
-
For everything else, use:
|
|
87
|
-
- `mcp__context-mode__ctx_batch_execute(commands, queries)` — run multiple commands + search in ONE call
|
|
88
|
-
- `mcp__context-mode__ctx_execute(language: "shell", code: "...")` — run in sandbox, only stdout enters context
|
|
89
|
-
|
|
90
|
-
### read_file (for analysis)
|
|
91
|
-
If you are reading a file to **edit** it → read_file is correct (edit needs content in context).
|
|
92
|
-
If you are reading to **analyze, explore, or summarize** → use `mcp__context-mode__ctx_execute_file(path, language, code)` instead. Only your printed summary enters context.
|
|
93
|
-
|
|
94
|
-
### grep / search (large results)
|
|
95
|
-
Search results can flood context. Use `mcp__context-mode__ctx_execute(language: "shell", code: "grep ...")` to run searches in sandbox. Only your printed summary enters context.
|
|
96
|
-
|
|
97
|
-
## Tool selection hierarchy
|
|
98
|
-
|
|
99
|
-
1. **GATHER**: `mcp__context-mode__ctx_batch_execute(commands, queries)` — Primary tool. Runs all commands, auto-indexes output, returns search results. ONE call replaces 30+ individual calls.
|
|
100
|
-
2. **FOLLOW-UP**: `mcp__context-mode__ctx_search(queries: ["q1", "q2", ...])` — Query indexed content. Pass ALL questions as array in ONE call.
|
|
101
|
-
3. **PROCESSING**: `mcp__context-mode__ctx_execute(language, code)` | `mcp__context-mode__ctx_execute_file(path, language, code)` — Sandbox execution. Only stdout enters context.
|
|
102
|
-
4. **WEB**: `mcp__context-mode__ctx_fetch_and_index(url, source)` then `mcp__context-mode__ctx_search(queries)` — Fetch, chunk, index, query. Raw HTML never enters context.
|
|
103
|
-
5. **INDEX**: `mcp__context-mode__ctx_index(content, source)` — Store content in FTS5 knowledge base for later search.
|
|
104
|
-
|
|
105
|
-
## Output constraints
|
|
106
|
-
|
|
107
|
-
- Keep responses under 500 words.
|
|
108
|
-
- Write artifacts (code, configs, PRDs) to FILES — never return them as inline text. Return only: file path + 1-line description.
|
|
109
|
-
- When indexing content, use descriptive source labels so others can `search(source: "label")` later.
|
|
110
|
-
|
|
111
|
-
## ctx commands
|
|
112
|
-
|
|
113
|
-
| Command | Action |
|
|
114
|
-
|---------|--------|
|
|
115
|
-
| `ctx stats` | Call the `stats` MCP tool and display the full output verbatim |
|
|
116
|
-
| `ctx doctor` | Call the `doctor` MCP tool, run the returned shell command, display as checklist |
|
|
117
|
-
| `ctx upgrade` | Call the `upgrade` MCP tool, run the returned shell command, display as checklist |
|
package/QWEN.md
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
# Quantix MCP Server Context
|
|
2
|
-
|
|
3
|
-
This project is a [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server that provides a bridge between AI models and the **Quantix Personal Finance API**. It allows AI assistants to manage accounts, transactions, categories, credit cards, and financial summaries.
|
|
4
|
-
|
|
5
|
-
## Project Overview
|
|
6
|
-
|
|
7
|
-
- **Purpose**: Expose Quantix API endpoints as MCP tools for personal finance management.
|
|
8
|
-
- **Authentication**: Uses **API Key authentication** (`x-api-key` header). Although the Quantix API supports JWT/Bearer tokens for web use, they expire every 15 minutes. For persistent MCP access, a long-lived API Key is required.
|
|
9
|
-
- **Architecture**:
|
|
10
|
-
- **Modular Tools**: Tools are categorized by domain (e.g., `accounts.ts`, `transactions.ts`) in `src/tools/`.
|
|
11
|
-
- **Centralized API Client**: `src/services/apiClient.ts` handles communication with the Quantix API using a singleton `apiClient`.
|
|
12
|
-
- **Schema Validation**: Extensive use of [Zod](https://zod.dev/) in `src/types/schemas.ts` to ensure input/output safety and provide descriptive metadata for the AI.
|
|
13
|
-
- **Configuration**: Managed via `dotenv` and validated with Zod in `src/config.ts`.
|
|
14
|
-
- **Key Technologies**: TypeScript, Node.js, @modelcontextprotocol/sdk, Zod, Vitest.
|
|
15
|
-
|
|
16
|
-
## Building and Running
|
|
17
|
-
|
|
18
|
-
### Prerequisites
|
|
19
|
-
- Node.js (v18+)
|
|
20
|
-
- Valid `QUANTIX_API_URL` and `QUANTIX_API_KEY` in a `.env` file.
|
|
21
|
-
|
|
22
|
-
### Commands
|
|
23
|
-
- **Install Dependencies**: `npm install`
|
|
24
|
-
- **Build**: `npm run build` (Compiles TypeScript to `dist/`)
|
|
25
|
-
- **Development**: `npm run dev` (Runs directly from source using `tsx`)
|
|
26
|
-
- **Production**: `npm start` (Runs the compiled `dist/index.js`)
|
|
27
|
-
- **Test**: `npm test` (Runs the test suite using Vitest)
|
|
28
|
-
- **MCP Inspector**: `npx @modelcontextprotocol/inspector node dist/index.js` (Recommended for interactive tool testing)
|
|
29
|
-
|
|
30
|
-
## Development Conventions
|
|
31
|
-
|
|
32
|
-
### Adding New Tools
|
|
33
|
-
1. Define the input/output schemas in `src/types/schemas.ts`.
|
|
34
|
-
2. Create or update the relevant domain file in `src/tools/`.
|
|
35
|
-
3. Use the `registerTool` method on the `McpServer` instance.
|
|
36
|
-
4. Export a registration function (e.g., `registerNewDomainTools`) and call it in `src/index.ts`.
|
|
37
|
-
|
|
38
|
-
### Error Handling
|
|
39
|
-
- Use the `handleToolError` helper from `src/utils/toolHelpers.ts` to provide consistent error messages to the AI.
|
|
40
|
-
- The `apiClient` throws `ApiClientError` for non-2xx responses, which includes the status code and status text.
|
|
41
|
-
|
|
42
|
-
### Tool Guidelines
|
|
43
|
-
- **Descriptions**: Always provide clear, detailed descriptions for tools and their arguments in the Zod schemas (using `.describe()`). This helps the AI understand when and how to use the tool.
|
|
44
|
-
- **Idempotency**: Ensure that "Get" operations are read-only and mutations follow standard REST patterns.
|
|
45
|
-
- **Validation**: Rely on Zod for input validation. If a required field is missing, the MCP SDK will automatically inform the user/AI.
|
|
46
|
-
|
|
47
|
-
### Testing
|
|
48
|
-
- Place tests in the `tests/` directory.
|
|
49
|
-
- Use `tests/setup.ts` to mock the global `fetch` and the project `config`.
|
|
50
|
-
- Aim for high coverage of tool logic by mocking various API responses.
|
|
51
|
-
|
|
52
|
-
## Environment Variables
|
|
53
|
-
| Variable | Description | Default |
|
|
54
|
-
|----------|-------------|---------|
|
|
55
|
-
| `QUANTIX_API_URL` | Base URL for the Quantix API | `https://api.quantix.example.com` |
|
|
56
|
-
| `QUANTIX_API_KEY` | Your secret API Key | (Required) |
|
|
57
|
-
| `MCPPORT` | Port for HTTP transport (if used) | `3001` |
|
|
58
|
-
| `NODE_ENV` | Environment mode | `development` |
|
|
59
|
-
|
|
60
|
-
# context-mode — MANDATORY routing rules
|
|
61
|
-
|
|
62
|
-
You have context-mode MCP tools available. These rules are NOT optional — they protect your context window from flooding. A single unrouted command can dump 56 KB into context and waste the entire session.
|
|
63
|
-
|
|
64
|
-
## BLOCKED commands — do NOT attempt these
|
|
65
|
-
|
|
66
|
-
### curl / wget — BLOCKED
|
|
67
|
-
Any shell command containing `curl` or `wget` will be intercepted and blocked. Do NOT retry.
|
|
68
|
-
Instead use:
|
|
69
|
-
- `mcp__context-mode__ctx_fetch_and_index(url, source)` to fetch and index web pages
|
|
70
|
-
- `mcp__context-mode__ctx_execute(language: "javascript", code: "const r = await fetch(...)")` to run HTTP calls in sandbox
|
|
71
|
-
|
|
72
|
-
### Inline HTTP — BLOCKED
|
|
73
|
-
Any shell command containing `fetch('http`, `requests.get(`, `requests.post(`, `http.get(`, or `http.request(` will be intercepted and blocked. Do NOT retry with shell.
|
|
74
|
-
Instead use:
|
|
75
|
-
- `mcp__context-mode__ctx_execute(language, code)` to run HTTP calls in sandbox — only stdout enters context
|
|
76
|
-
|
|
77
|
-
### WebFetch / web browsing — BLOCKED
|
|
78
|
-
Direct web fetching is blocked. Use the sandbox equivalent.
|
|
79
|
-
Instead use:
|
|
80
|
-
- `mcp__context-mode__ctx_fetch_and_index(url, source)` then `mcp__context-mode__ctx_search(queries)` to query the indexed content
|
|
81
|
-
|
|
82
|
-
## REDIRECTED tools — use sandbox equivalents
|
|
83
|
-
|
|
84
|
-
### Shell (>20 lines output)
|
|
85
|
-
Shell is ONLY for: `git`, `mkdir`, `rm`, `mv`, `cd`, `ls`, `npm install`, `pip install`, and other short-output commands.
|
|
86
|
-
For everything else, use:
|
|
87
|
-
- `mcp__context-mode__ctx_batch_execute(commands, queries)` — run multiple commands + search in ONE call
|
|
88
|
-
- `mcp__context-mode__ctx_execute(language: "shell", code: "...")` — run in sandbox, only stdout enters context
|
|
89
|
-
|
|
90
|
-
### read_file (for analysis)
|
|
91
|
-
If you are reading a file to **edit** it → read_file is correct (edit needs content in context).
|
|
92
|
-
If you are reading to **analyze, explore, or summarize** → use `mcp__context-mode__ctx_execute_file(path, language, code)` instead. Only your printed summary enters context.
|
|
93
|
-
|
|
94
|
-
### grep / search (large results)
|
|
95
|
-
Search results can flood context. Use `mcp__context-mode__ctx_execute(language: "shell", code: "grep ...")` to run searches in sandbox. Only your printed summary enters context.
|
|
96
|
-
|
|
97
|
-
## Tool selection hierarchy
|
|
98
|
-
|
|
99
|
-
1. **GATHER**: `mcp__context-mode__ctx_batch_execute(commands, queries)` — Primary tool. Runs all commands, auto-indexes output, returns search results. ONE call replaces 30+ individual calls.
|
|
100
|
-
2. **FOLLOW-UP**: `mcp__context-mode__ctx_search(queries: ["q1", "q2", ...])` — Query indexed content. Pass ALL questions as array in ONE call.
|
|
101
|
-
3. **PROCESSING**: `mcp__context-mode__ctx_execute(language, code)` | `mcp__context-mode__ctx_execute_file(path, language, code)` — Sandbox execution. Only stdout enters context.
|
|
102
|
-
4. **WEB**: `mcp__context-mode__ctx_fetch_and_index(url, source)` then `mcp__context-mode__ctx_search(queries)` — Fetch, chunk, index, query. Raw HTML never enters context.
|
|
103
|
-
5. **INDEX**: `mcp__context-mode__ctx_index(content, source)` — Store content in FTS5 knowledge base for later search.
|
|
104
|
-
|
|
105
|
-
## Output constraints
|
|
106
|
-
|
|
107
|
-
- Keep responses under 500 words.
|
|
108
|
-
- Write artifacts (code, configs, PRDs) to FILES — never return them as inline text. Return only: file path + 1-line description.
|
|
109
|
-
- When indexing content, use descriptive source labels so others can `search(source: "label")` later.
|
|
110
|
-
|
|
111
|
-
## ctx commands
|
|
112
|
-
|
|
113
|
-
| Command | Action |
|
|
114
|
-
|---------|--------|
|
|
115
|
-
| `ctx stats` | Call the `stats` MCP tool and display the full output verbatim |
|
|
116
|
-
| `ctx doctor` | Call the `doctor` MCP tool, run the returned shell command, display as checklist |
|
|
117
|
-
| `ctx upgrade` | Call the `upgrade` MCP tool, run the returned shell command, display as checklist |
|
package/docker-compose.yml
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
services:
|
|
2
|
-
quantix-mcp:
|
|
3
|
-
build: .
|
|
4
|
-
ports:
|
|
5
|
-
- "${MCPPORT:-3001}:${MCPPORT:-3001}"
|
|
6
|
-
environment:
|
|
7
|
-
TRANSPORT: http
|
|
8
|
-
MCPPORT: ${MCPPORT:-3001}
|
|
9
|
-
labels:
|
|
10
|
-
- "traefik.http.services.quantix-mcp.loadbalancer.server.port=${MCPPORT:-3001}"
|
|
11
|
-
restart: unless-stopped
|
|
12
|
-
healthcheck:
|
|
13
|
-
test: ["CMD", "node", "-e", "fetch('http://localhost:' + (process.env.MCPPORT || 3001) + '/health').then(r => process.exit(r.ok ? 0 : 1)).catch(() => process.exit(1))"]
|
|
14
|
-
interval: 30s
|
|
15
|
-
timeout: 5s
|
|
16
|
-
retries: 3
|
|
17
|
-
start_period: 10s
|