MCP server

The Model Context Protocol (MCP) is a standard that lets an AI client such as Claude or Cursor call outside tools. This server exposes the site's data and its source books as five tools, so a model can answer from a record or a cited passage and give the page it used.

Endpoint

https://medievalbulgaria.com/api/mcp

A remote server over Streamable HTTP. There is no key and no session. Each call is one POST request with a JSON-RPC body. Clients that only support stdio servers can reach it through the mcp-remote package, shown below.

Tools

list_datasets

Lists every dataset with its description, record count and URL, and the export files.

  • Parameters: none
  • Returns: The API index as JSON.

get_dataset

Returns the records of one dataset, paged. With query, only records whose JSON contains the text, matched without regard to case.

  • Parameters: dataset (string, required); query (string); limit (integer, default 50, max 200); offset (integer)
  • Returns: dataset, total, offset, limit, items.

get_record

Returns one record with all its fields. For the pages dataset this includes the full article in both languages.

  • Parameters: dataset (string, required); id (string, required)
  • Returns: The record as JSON.

search_site

Searches the site's pages, rulers, coins, manuscripts and map realms.

  • Parameters: query (string, required); lang (en or bg); kind (person, page, coin, manuscript, realm); limit (integer)
  • Returns: total, facets, and results with kind, title, subtitle, snippet, url and years.

ask_sources

Answers a question from the printed source books with numbered citations to book and page, or states that the books do not cover it.

  • Parameters: question (string, required, up to 500 characters); lang (en or bg)
  • Returns: The answer as Markdown with [n] markers, followed by a numbered list of book and page.

Connecting a client

Claude Code

claude mcp add --transport http medievalbulgaria https://medievalbulgaria.com/api/mcp

Cursor

{
"mcpServers": {
"medievalbulgaria": { "url": "https://medievalbulgaria.com/api/mcp" }
}
}

Claude Desktop and other clients with a settings file

{
"mcpServers": {
"medievalbulgaria": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://medievalbulgaria.com/api/mcp"]
}
}
}

Plain HTTP

The protocol is JSON-RPC 2.0. A client sends initialize, then tools/list, then tools/call with a tool name and arguments. The call below needs no client:

curl -X POST https://medievalbulgaria.com/api/mcp -H "Content-Type: application/json" -d '{
"jsonrpc": "2.0", "id": 1, "method": "tools/call",
"params": { "name": "get_record", "arguments": { "dataset": "rulers", "id": "kaloyan" } }
}'

Example questions

With the server connected, a model can handle questions such as: which tsars reigned between 1241 and 1280 and who were their fathers (get_dataset on rulers); every silver coin type of Ivan Alexander with its mint (get_dataset on coins with a query); where the site covers Klokotnitsa (search_site); what the books say about the murder of Kaloyan (ask_sources, with citations).

Limits

The three data tools read the same static files as the API and have no limit. search_site has no limit. ask_sources runs a language model and allows a burst of 5 calls and 120 calls a day per IP address, the same as the site's search page. Over the limit it returns a message in the tool result rather than an error.