Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.2.2] - 2026-02-01

- Fix MCP tool naming for Claude Desktop

## [0.2.1] - 2026-02-01

- Fix MCP notifications handling
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ mermkit ships an MCP server over stdio. Any MCP-compatible host (Claude Desktop,
}
```

Once connected, the host gains access to the same five tools listed above (`mermkit.render`, `mermkit.renderBatch`, `mermkit.extract`, `mermkit.term`, `mermkit.schema`). The MCP server reuses the same rendering and extraction logic as `serve` — it is a format translation layer (JSON-RPC 2.0) with no additional dependencies.
Once connected, the host gains access to the same five tools listed above. In MCP hosts that restrict tool names, they are exposed as `mermkit_render`, `mermkit_renderBatch`, `mermkit_extract`, `mermkit_term`, and `mermkit_schema`. The MCP server reuses the same rendering and extraction logic as `serve` — it is a format translation layer (JSON-RPC 2.0) with no additional dependencies.

## Preview server

Expand Down
2 changes: 1 addition & 1 deletion bindings/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "mermkit"
version = "0.2.1"
version = "0.2.2"
description = "Python bindings for mermkit (Mermaid rendering toolkit)"
readme = "README.md"
requires-python = ">=3.8"
Expand Down
2 changes: 1 addition & 1 deletion bindings/rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mermkit"
version = "0.2.1"
version = "0.2.2"
edition = "2021"
description = "Rust bindings for mermkit (Mermaid rendering toolkit)"
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mermkit",
"private": true,
"version": "0.2.1",
"version": "0.2.2",
"repository": {
"type": "git",
"url": "https://github.com/MermaidKit/mermkit.git"
Expand Down
4 changes: 2 additions & 2 deletions packages/adapters/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mermkit/adapters",
"version": "0.2.1",
"version": "0.2.2",
"repository": {
"type": "git",
"url": "https://github.com/MermaidKit/mermkit.git"
Expand All @@ -18,6 +18,6 @@
"build": "tsc -b"
},
"dependencies": {
"@mermkit/core": "0.2.1"
"@mermkit/core": "0.2.2"
}
}
8 changes: 4 additions & 4 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mermkit/cli",
"version": "0.2.1",
"version": "0.2.2",
"repository": {
"type": "git",
"url": "https://github.com/MermaidKit/mermkit.git"
Expand All @@ -19,8 +19,8 @@
"build": "tsc -b"
},
"dependencies": {
"@mermkit/core": "0.2.1",
"@mermkit/render": "0.2.1",
"@mermkit/adapters": "0.2.1"
"@mermkit/core": "0.2.2",
"@mermkit/render": "0.2.2",
"@mermkit/adapters": "0.2.2"
}
}
24 changes: 22 additions & 2 deletions packages/cli/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -761,9 +761,29 @@ function maybeWriteMcpResponse(
writeMcpResponse({ ...response, id });
}

const MCP_TOOL_NAME_MAP = new Map<string, string>();

function toMcpToolName(name: string): string {
return name.replace(/\./g, "_");
}

function getMcpToolNameMap(): Map<string, string> {
if (MCP_TOOL_NAME_MAP.size === 0) {
for (const tool of buildToolDefinitions()) {
MCP_TOOL_NAME_MAP.set(toMcpToolName(tool.name), tool.name);
}
}
return MCP_TOOL_NAME_MAP;
}

function resolveMcpToolName(name: string): string {
if (name.includes(".")) return name;
return getMcpToolNameMap().get(name) ?? name;
}

function buildMcpToolDefinitions(): Array<{ name: string; description: string; inputSchema: Record<string, unknown> }> {
return buildToolDefinitions().map((tool) => ({
name: tool.name,
name: toMcpToolName(tool.name),
description: tool.description,
inputSchema: tool.parameters
}));
Expand Down Expand Up @@ -806,7 +826,7 @@ async function cmdMcp(): Promise<void> {

if (request.method === "tools/call") {
const params = request.params ?? {};
const toolName = params.name as string;
const toolName = resolveMcpToolName(params.name as string);
const toolInput = (params.input ?? {}) as Record<string, unknown>;

try {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mermkit/core",
"version": "0.2.1",
"version": "0.2.2",
"repository": {
"type": "git",
"url": "https://github.com/MermaidKit/mermkit.git"
Expand Down
4 changes: 2 additions & 2 deletions packages/render/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mermkit/render",
"version": "0.2.1",
"version": "0.2.2",
"repository": {
"type": "git",
"url": "https://github.com/MermaidKit/mermkit.git"
Expand All @@ -18,7 +18,7 @@
"build": "tsc -b"
},
"dependencies": {
"@mermkit/core": "0.2.1"
"@mermkit/core": "0.2.2"
},
"optionalDependencies": {
"dompurify": "^3.1.5",
Expand Down
Loading