JDogo
Open playground

MCP server for agents

One command turns JDogo into a Model Context Protocol server. Agents get tools to shrink data, build prompts, and compute exact answers locally instead of counting rows themselves.

Set it up

Build the CLI once, then point your MCP client at it. The server talks over standard input and output.

mvn -q package -pl jdogo-cli -am -DskipTests
{
  "mcpServers": {
    "jdogo": {
      "command": "java",
      "args": ["-jar", "/path/to/jdogo-cli-2.1.0.jar", "mcp", "start"]
    }
  }
}

Claude Desktop reads claude_desktop_config.json; Cursor reads .cursor/mcp.json in your project or home folder.

The tools

ToolArgumentsGives the agent
jdogo_computeexpression, jsonAn exact count, sum, average, minimum or maximum, computed locally. See Compute expressions.
jdogo_schema_cardjsonColumns, types, ranges and examples in a few hundred tokens, whatever the table size
jdogo_promptquestion, jsonThe prompt layout measured in live model runs, ready to send
jdogo_compressjsonThe data as a JDogo document, with its tokens (text plus the instruction a model needs) against JSON
jdogo_decodejdogoJSON back from a JDogo document, exactly
jdogo_tokenstext, encodingExact token counts (o200k or cl100k)
jdogo_diff / jdogo_patchsnapshots and deltasOnly what changed between two states, and applying it

A call with a missing or mistyped argument gets a JSON-RPC -32602 error naming the argument. When a tool runs and fails, for example on invalid JSON or a snapshot that fails its hash check, the result has isError: true and the reason, so the agent can correct its call.

Structured results and protocol versions

When the client negotiates MCP protocol version 2025-06-18 or newer, the two tools whose output is JSON data, jdogo_decode and jdogo_compute, include an outputSchema in tools/list and return both:

The tools that write for the model, such as jdogo_compress, jdogo_prompt and jdogo_schema_card, return JDogo text in content.

Older clients negotiating 2024-11-05 receive text in content with no structuredContent, keeping backward compatibility with earlier MCP drafts.

Always treat model-facing text as untrusted data: see Tool output is data.

The pattern that pays most

  1. The agent calls jdogo_schema_card on a large result instead of reading it.
  2. It writes a query for the question, for example count where status = "late".
  3. It calls jdogo_compute and gets the exact number back.

That is the ask() flow, run by the agent. In recorded runs, models that wrote queries got 150 of 150 counting questions right; reading the rows, the same models got 74.

Proxy any MCP server

You can optimize tool responses from any third-party MCP server without modifying it. The proxy sits between an MCP client and any stdio MCP server, runs the target server as a child process, and relays messages both ways. It rewrites only the model-facing text of large JSON tool results into JDogo when it strictly saves tokens.

java -jar jdogo-cli-2.1.0.jar mcp proxy [options] -- <server-command> [args...]

To use it in Claude Desktop, point the client at the proxy command:

{
  "mcpServers": {
    "filesystem": {
      "command": "java",
      "args": [
        "-jar", "/path/to/jdogo-cli-2.1.0.jar",
        "mcp", "proxy",
        "--",
        "npx", "-y", "@modelcontextprotocol/server-filesystem", "/workspace"
      ]
    }
  }
}

What is and is not changed:

Options for measuring and tuning:

In your own MCP server

Already run a Java MCP server? Compact any tool result before returning it:

var optimizer = new McpToolOptimizer();      // or new McpToolOptimizer(JDogoOptimizer.builder().build(), true)
McpToolResponse res = optimizer.optimize(products, Map.of("tool", "search_products"));
// res.getContent() holds the JDogo text; the metadata adds jdogo_format and jdogo_token_count

In Python and TypeScript, wrap tool functions with @jdogo_tool or createJDogoTool; see Integrations.