Ditto MCP server — knowledge RAG + credential-passthrough action tools - #2522
Open
kalinkostashki wants to merge 11 commits into
Open
Ditto MCP server — knowledge RAG + credential-passthrough action tools#2522kalinkostashki wants to merge 11 commits into
kalinkostashki wants to merge 11 commits into
Conversation
…TTP transports Zod-validated AppConfig + loader, ToolDef/ToolRegistry core, ping tool, server factory, stdio and streamable-HTTP entrypoints (loopback bind, session store, DNS-rebinding protection), request-context threading. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Chunk/KnowledgeSource/Retriever types, markdown chunker, SQLite FTS5 retriever, PublicSource llms.txt loader, KnowledgeService + search/get_chunk tools wired via config, shared async service across sessions. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…RRF fusion Local ONNX bge-small embeddings, sqlite-vec store + VectorRetriever, HybridRetriever (reciprocal rank fusion), LocalDirSource corpus, config-selectable fts/vector/hybrid, lazy ONNX load, markdown-only ingest, bounded-concurrency fetch, batched embeddings (OOM fix), limit param + provenance. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…, pgvector File-backed KnowledgeStore (chunks+FTS5+vectors), read-only retrievers over the store, ingest CLI, atomic ingest (temp+rename), index metadata validation, async store lifecycle + openStore factory, PgKnowledgeStore (pgvector + tsvector) with testcontainers pg tests. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ToolPolicy OpenAPI operation parser + operation-to-tool generation with pinned bundled spec, HttpDittoClient, credential passthrough (basic/devops/OIDC client-credentials, config + per-session), ToolPolicy (read-only default, write allowlist, spec-security-aware sudo gating), typed request-body schemas. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Consolidated README, example configs, hardened .gitignore; docs for HTTP/config, knowledge/persistence/pgvector, action tools/passthrough/policy, OIDC + typed bodies. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Squashes the devops-credential and openapi-spec-source work. Devops credential: - Add optional `ditto.devopsCredential` used exclusively for sudo-classified operations (/devops/*, sudo*, and the secret-bearing /api/2/connections* API); all other operations use `ditto.credential`. - Sudo ops are refused at the MCP layer when no devopsCredential is set. Connectivity is classified sudo via a spec-independent path rule so it is always devops-gated. - Remove the `devops` credential kind and the `isDevops` flag: devops capability is now positional (which credential slot). A per-session Authorization header overrides the selected credential without inheriting devops status. Credential kind is now `basic | oidc` only. OpenAPI spec source: - Resolve the spec by precedence path > url > version > in-repo canonical; add `openApi.version` (git tag/ref) and `openApi.versionUrlTemplate`. - Default fallback reads the canonical in-repo spec (documentation/src/main/resources/openapi/ditto-api-2.yml) instead of a committed duplicate; drop mcp/assets/ditto-openapi.yml. BREAKING CHANGE: kind:"devops" and the devops:true flag are removed; move a devops credential into ditto.devopsCredential. Sudo operations now require ditto.devopsCredential to be set. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Dockerfile (multistage node:22-slim, glibc), .dockerignore, and
docker/config.docker.json: HTTP transport, non-root, native deps baked in.
Secure-by-default DNS rebinding protection + loopback allowedHosts.
- bin shebangs so stdio/http/ingest run as installed CLIs.
- Lazy-load sqlite/pg store backends and local embeddings; friendly errors
naming the missing native dep instead of raw MODULE_NOT_FOUND.
- knowledge.chunk.{maxChars,overlap} config wired through makeSources to
PublicSource + LocalDirSource (was hardcoded to chunker defaults).
- README: Docker Deployment and Chunking sections (incl. bge-small
512-token ceiling for vector/hybrid).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Retriever-agnostic context expansion in KnowledgeService.search: around each
anchor, pull ±context same-document chunks (same cite, adjacent ordinal) by id
— never re-scored or re-embedded. Results are deduped and emitted as contiguous
spans ordered by best anchor rank; neighbors are tagged role="context" so their
relevance isn't over-weighted vs. matches.
- Stops at document boundaries (different cite) even when ordinals are globally
contiguous, so expansion never leaks across docs.
- knowledge.search.{limit,context} config (defaults 5 / 1); search tool gains a
per-call `context` arg that overrides. `limit` counts anchors; neighbors extra.
- Works for fts/vector/hybrid: an anchor's neighbors are defined by document
layout, not by how it was matched — so expansion is embedding-neutral and
sidesteps the 512-token ceiling.
- README: Search (query-time) section incl. overlap-vs-expansion interaction.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
kalinkostashki
force-pushed
the
ditto-mcp-server
branch
from
August 18, 2026 04:51
b0b1bc9 to
82b6715
Compare
- removed writeAllowlist underscores from configs - stripped unnecessary underscores from tools generation - updated documentation to reflect the changes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an extensible Ditto MCP server (TypeScript, @modelcontextprotocol/sdk) under mcp/. It gives AI agents (e.g. Claude Code) two capabilities over one server:
All new code lives in mcp/; no existing files are modified. 31 test files; default suite is hermetic (Postgres tests are opt-in behind test:pg + Docker).
What's included (by commit / phase)
Configuration scenarios (see mcp/examples/)
Testing
Verified end-to-end against a live k3d Ditto (basic ditto:ditto, devops devops:devops):
Security notes
How to run
cd mcp && npm install && npm run build
DITTO_MCP_CONFIG=examples/public-fts.json node dist/bin/ingest.js # build the index
DITTO_MCP_CONFIG=examples/public-fts.json node dist/bin/stdio.js # or dist/bin/http.js