Skip to content

Introduction to the MCP Server

The MCP server for EventSourcingDB is an extension that connects large language models (LLMs) with a running EventSourcingDB instance. It implements the Model Context Protocol (MCP), an open standard that defines how AI models discover and invoke external tools.

How the MCP Server Works

The MCP server sits between your LLM and EventSourcingDB. When an LLM connects to the MCP server, it receives a list of available tools that describe operations such as reading events, writing events, querying with EventQL, or listing subjects. The LLM can then decide which tools to call based on your natural language prompts.

The communication between the LLM and the MCP server uses Streamable HTTP as the transport protocol. The MCP server, in turn, communicates with EventSourcingDB through its HTTP API, translating tool calls into the appropriate API requests and returning the results back to the LLM.

In short, the flow looks like this: your LLM connects to the MCP server over Streamable HTTP, the MCP server calls the EventSourcingDB HTTP API, and the results travel back through the same chain to appear in your conversation.

When to Use the MCP Server

The MCP server is particularly useful for interactive and exploratory workflows. If you want to browse the events in a store, understand the structure of your event types, prototype EventQL queries, or onboard new team members by letting them ask questions in natural language, the MCP server provides a convenient interface for all of these tasks.

It is also a good fit for rapid prototyping. Instead of writing code to test whether a particular query returns the expected results, you can simply ask your LLM and get an immediate answer.

When Not to Use the MCP Server

The MCP server is not intended for production write paths. Writing events in a real application should go through a Client SDK or the HTTP API directly, where you have full control over preconditions, error handling, and transactional guarantees.

Similarly, high-throughput pipelines that process large volumes of events are better served by direct API access. The MCP server adds a layer of interpretation that is valuable for human interaction but unnecessary for automated systems.

Looking for a Lighter Alternative?

If you just want to quickly explore your event store from the terminal without running a Docker container, consider the Claude Code Plugin instead. It installs in seconds and lets you interact with EventSourcingDB directly from Claude Code using natural language.

To set up the MCP server and connect it to your EventSourcingDB instance, see Getting Started.