@acruxcoreai/mcp-server 0.0.0-stage → 0.2.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,78 @@
1
+ # Changelog
2
+
3
+ All notable changes to `@acruxcoreai/mcp-server` are documented here.
4
+
5
+ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this
6
+ package follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## Unreleased
9
+
10
+ ## 0.2.0 — 2026-10-22
11
+
12
+ ### Added
13
+
14
+ - **`optimize_prompt`**, **`get_optimize_report`** and **`promote_optimize_candidate`**
15
+ (`evaluations` toolset). Start an optimizer run, read each rewrite's score against the
16
+ baseline with the candidate id and rationale, and ship one as a new version.
17
+ - `promote_optimize_candidate` refuses a rewrite that did not improve on at least one model,
18
+ or that regressed or has no scores on any, unless `promote_without_improvement` is set.
19
+ Read-only mode hides `optimize_prompt` and `promote_optimize_candidate`.
20
+ - `promote_optimize_candidate` moves the alias the run was scored against by default. It
21
+ refuses when that alias now points at another version than the one scored, since nothing
22
+ compared the rewrite with it; `promote_without_improvement` overrides this too.
23
+ - When six long rewrites do not fit in one result, `get_optimize_report` leaves out their
24
+ messages (`messagesOmitted`) and keeps every id and score; `candidate_id` reads one in full.
25
+ - **`get_spending_limits`** (`gateway` toolset, read-only). Lists every budget with its
26
+ period, limit, live spend, `remainingUsd`, `exhausted` and reset time, names the virtual
27
+ key a budget belongs to, and lists the keys masked to their last four characters.
28
+
29
+ ### Changed
30
+
31
+ - `run_prompt` and `chat_completion` now name the trace id on their summary line, as
32
+ `trace_id <uuid>`. The JSON part also carries `request-id`, another UUID, and a client
33
+ that took the first UUID it saw passed that one to `get_trace` and got a 404.
34
+
35
+ ### Fixed
36
+
37
+ - `get_experiment_run` always reported "0 result(s)" on its summary line. It read
38
+ `results.length`, but the API returns `results` as `{ total, succeeded, errored }`.
39
+
40
+ ## 0.1.0 — 2026-10-18
41
+
42
+
43
+ First release.
44
+
45
+ ### Added
46
+
47
+ - **Model Context Protocol server for AcruxCore**, shipped two ways: a stdio binary
48
+ (`npx @acruxcoreai/mcp-server`) and a hosted Streamable HTTP endpoint at
49
+ `POST /api/v1/mcp` on any AcruxCore instance. Both register the same tools, so a tool
50
+ added once appears on both.
51
+ - **28 tools across five toolsets.** `prompts` — `list_prompts`, `get_prompt`,
52
+ `render_prompt`, `diff_prompt_versions`, `create_prompt`, `commit_prompt_version`,
53
+ `promote_prompt_alias`. `gateway` — `run_prompt`, `chat_completion`, `list_models`,
54
+ `get_gateway_usage`. `tools` — `list_catalog_tools`, `get_catalog_tool`,
55
+ `sync_catalog_tool`, `execute_catalog_tool`. `traces` — `search_traces`, `get_trace`,
56
+ `get_trace_analytics`, `list_sessions`, `get_session`, `submit_trace_feedback`.
57
+ `evaluations` — `list_datasets`, `get_dataset`, `create_dataset`,
58
+ `add_dataset_example`, `run_experiment`, `list_experiment_runs`, `get_experiment_run`.
59
+ - **Registry prompts as MCP prompts.** Every prompt in the team's registry is exposed
60
+ through MCP's prompts primitive at the `production` alias, with the version's template
61
+ variables as typed arguments. `ACRUXCORE_MCP_PROMPT_ALIAS` selects a different alias.
62
+ - **`acruxcore://` resources.** `acruxcore://prompts/{name}/{alias}` reads back the raw,
63
+ unrendered template of the version an alias points at;
64
+ `acruxcore://traces/{traceId}` reads one trace with its full span tree.
65
+ - **Names work wherever ids do.** Any tool taking a prompt or a catalog tool accepts the
66
+ name or the UUID, and an unknown name comes back as a `NOT_FOUND` listing the closest
67
+ matches rather than a silent near-miss.
68
+ - **`--read-only` removes mutating tools from the listing** rather than refusing them
69
+ when called, so a model cannot choose a tool it never sees.
70
+ - **`--toolsets`** narrows the surface to any subset of the five.
71
+ - Configuration by environment variable or CLI flag, the flag winning:
72
+ `ACRUXCORE_API_KEY`, `ACRUXCORE_BASE_URL`, `ACRUXCORE_MCP_TOOLSETS`,
73
+ `ACRUXCORE_MCP_READ_ONLY`, `ACRUXCORE_MCP_PROMPT_ALIAS`,
74
+ `ACRUXCORE_MCP_MAX_TEXT_BYTES`, `ACRUXCORE_MCP_TIMEOUT_MS`.
75
+ - **`initialize` instructions follow the registered tools.** A `--read-only` server
76
+ tells the model the connection is read-only and never names a tool it lacks.
77
+ - **`diff_prompt_versions` says when two versions have identical messages**, and points
78
+ to `get_prompt` for comparing the bound models and settings.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 AcruxCore
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 CHANGED
@@ -1,3 +1,119 @@
1
- # Temporary Holding Version
1
+ # @acruxcoreai/mcp-server
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The [Model Context Protocol](https://modelcontextprotocol.io) server for
4
+ [AcruxCore](https://acruxcore.com). It turns the platform — the prompt registry, the
5
+ versioned tool catalog, the AI gateway, tracing and evaluation — into tools any MCP
6
+ client can call, so an assistant can operate AcruxCore instead of being told which HTTP
7
+ endpoints to hit.
8
+
9
+ It also exposes your team's **registry prompts as MCP prompts**, so the prompts your
10
+ production traffic renders show up in the client as ready-to-use templates, with the
11
+ template variables as typed arguments.
12
+
13
+ ## Two ways to connect
14
+
15
+ **Hosted — nothing to install.** Point an MCP client that supports remote servers at
16
+ your AcruxCore instance:
17
+
18
+ ```
19
+ https://api.acruxcore.com/api/v1/mcp
20
+ ```
21
+
22
+ with an `Authorization: Bearer acx_sk_…` header. Create the key in the dashboard under
23
+ **Settings → API keys**.
24
+
25
+ **Local — stdio.** For clients that only speak stdio, or when you want to narrow the
26
+ tool surface:
27
+
28
+ ```jsonc
29
+ {
30
+ "mcpServers": {
31
+ "acruxcore": {
32
+ "command": "npx",
33
+ "args": ["-y", "@acruxcoreai/mcp-server"],
34
+ "env": {
35
+ "ACRUXCORE_API_KEY": "acx_sk_…",
36
+ "ACRUXCORE_BASE_URL": "https://api.acruxcore.com/api/v1"
37
+ }
38
+ }
39
+ }
40
+ }
41
+ ```
42
+
43
+ In Claude Code, one command does the same thing:
44
+
45
+ ```bash
46
+ claude mcp add acruxcore -e ACRUXCORE_API_KEY=acx_sk_… -- npx -y @acruxcoreai/mcp-server
47
+ ```
48
+
49
+ For a full walkthrough with a real Claude Code session, see
50
+ [Connect Claude to AcruxCore with MCP](https://docs.acruxcore.com/docs/guides/connect-an-mcp-client).
51
+ The endpoint reference is at
52
+ [docs.acruxcore.com/api-reference/mcp](https://docs.acruxcore.com/api-reference/mcp).
53
+
54
+ ## Configuration
55
+
56
+ Every option is an environment variable or a CLI flag; the flag wins.
57
+
58
+ | Env | Flag | Default | Meaning |
59
+ |---|---|---|---|
60
+ | `ACRUXCORE_API_KEY` | `--api-key` | *required* | Your `acx_sk_…` key. |
61
+ | `ACRUXCORE_BASE_URL` | `--base-url` | `https://api.acruxcore.com/api/v1` | Self-hosting? Point it at your instance. `/api/v1` is appended if you leave it off. |
62
+ | `ACRUXCORE_MCP_TOOLSETS` | `--toolsets` | all | Comma-separated: `prompts`, `gateway`, `tools`, `traces`, `evaluations`. |
63
+ | `ACRUXCORE_MCP_READ_ONLY` | `--read-only` | `false` | Drop every mutating tool from the listing. |
64
+ | `ACRUXCORE_MCP_PROMPT_ALIAS` | `--prompt-alias` | `production` | Which alias the prompts primitive exposes. |
65
+ | `ACRUXCORE_MCP_MAX_TEXT_BYTES` | `--max-text-bytes` | `40000` | Cap on the size of any single tool result. |
66
+ | `ACRUXCORE_MCP_TIMEOUT_MS` | `--timeout-ms` | `60000` | Per-request HTTP timeout. |
67
+
68
+ ### Read-only mode
69
+
70
+ `--read-only` removes the mutating tools from `tools/list` entirely rather than refusing
71
+ them when called. A tool that is absent cannot be chosen by mistake and cannot be talked
72
+ into running — which is the point of handing an agent a key it should not write with.
73
+
74
+ ## Tools
75
+
76
+ **Prompts** — `list_prompts`, `get_prompt`, `render_prompt`, `diff_prompt_versions`,
77
+ `create_prompt`, `commit_prompt_version`, `promote_prompt_alias`
78
+
79
+ **Gateway** — `run_prompt`, `chat_completion`, `list_models`, `get_gateway_usage`, `get_spending_limits`
80
+
81
+ **Tool catalog** — `list_catalog_tools`, `get_catalog_tool`, `sync_catalog_tool`,
82
+ `execute_catalog_tool`
83
+
84
+ **Traces** — `search_traces`, `get_trace`, `get_trace_analytics`, `list_sessions`,
85
+ `get_session`, `submit_trace_feedback`
86
+
87
+ **Evaluations** — `list_datasets`, `get_dataset`, `create_dataset`,
88
+ `add_dataset_example`, `run_experiment`, `list_experiment_runs`, `get_experiment_run`,
89
+ `optimize_prompt`, `get_optimize_report`, `promote_optimize_candidate`
90
+
91
+ Anywhere a tool takes a prompt or a catalog tool, a **name works as well as a UUID**.
92
+
93
+ ## Prompts and resources
94
+
95
+ Registry prompts appear through MCP's prompts primitive at the configured alias, with
96
+ their template variables as arguments. MCP has no system role, so a template's system
97
+ message is carried through as the leading `user` message with its text unchanged.
98
+
99
+ Two resource templates are registered:
100
+
101
+ - `acruxcore://prompts/{name}/{alias}` — the raw, unrendered template of the version an
102
+ alias points at.
103
+ - `acruxcore://traces/{traceId}` — one trace with its full span tree.
104
+
105
+ ## The model behind the tools
106
+
107
+ Three ideas explain nearly every tool here:
108
+
109
+ - A **prompt** is a named container. It holds no messages itself.
110
+ - A **version** is an immutable commit of that prompt's messages, numbered sequentially.
111
+ - An **alias** — `production`, `staging`, anything else — is a moving pointer at one
112
+ version.
113
+
114
+ Committing a version never moves an alias. `promote_prompt_alias` is what ships a
115
+ change, and promoting an earlier version number is how you roll back.
116
+
117
+ ## License
118
+
119
+ MIT
package/dist/bin.d.mts ADDED
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node
package/dist/bin.d.ts ADDED
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node