by HarperDB
Provides an interface for MCP clients to retrieve data from HarperDB using standardized JSON-RPC calls, exposing tables and custom resources as structured resources.
The server implements the Model Context Protocol (MCP) API for HarperDB, allowing clients to list available resources (tables and custom endpoints) and read their contents via a single /mcp JSON‑RPC endpoint.
{
"operation": "deploy_component",
"package": "@harperdb/mcp-server@1.0.0"
}
HOST environment variable to the base URL of the server (e.g., http://localhost:9925).POST /mcp:
{ "jsonrpc": "2.0", "id": 1, "method": "resources/list" }{ "jsonrpc": "2.0", "id": 2, "method": "resources/read", "params": { "uri": "http://localhost:9925/Customers" } }?attribute=value&limit=10&start=20) to filter or paginate table results./mcp)./capabilities.json describing server capabilities.attribute=value) and pagination (limit, start).Q: Do I need a specific HarperDB version? A: Yes, version 4.5.10 or later is required.
Q: How is authentication handled? A: The server relies on HarperDB’s built‑in authentication (Basic Auth, JWT, or mTLS). No separate auth mechanism is required.
Q: Can I modify data through this server? A: The server currently provides read‑only access; write operations are not exposed via MCP.
Q: Where can I find the list of supported methods?
A: resources/list and resources/read are the two MCP methods implemented.
Q: How are errors returned? A: Errors follow the JSON‑RPC 2.0 spec with codes such as -32601 (Method not found), -32602 (Invalid params), and -32603 (Internal server error).
A server implementation of the Model Context Protocol (MCP), designed to expose data in HarperDB as structured "Resources" accessible via standardized JSON-RPC calls.
Note: Requires HarperDB version 4.5.10 or later.
Harper is a Composable Application Platform that merges database, cache, app logic, and messaging into a single runtime. Components like this plug directly into Harper, letting you build and scale distributed services fast, without managing separate systems. Built for geo-distributed apps with low latency and high uptime by default.
/capabilities.json)HOST should be set to the base URL of your server. This is used to construct resource URIs.The Harper mcp-server is published to NPM and can be installed using Harper's Operation API.
i.e.
POST https://harper-server.com:9925
{
"operation": "deploy_component",
"package": "@harperdb/mcp-server@1.0.0"
}
Harper employs role-based, attribute-level security to ensure users access only authorized data. Requests to the server are authenticated using HarperDB's built-in authentication mechanisms, which include Basic Auth, JWT, and mTLS. See Harper Security Docs for more details.
The server implements the following MCP methods:
resources/list: Lists all available resources (HarperDB tables and custom resources).resources/read: Retrieves data for a specific resource based on its URI.A single endpoint, /mcp handles all requests. The server uses JSON-RPC 2.0 for communication.
Tables: Resources representing HarperDB tables are accessed via URIs like:
{HOST}/{table_name}
http://localhost:9925/my_tableTable Rows: Individual rows within a table can be accessed using the primary key:
{HOST}/{table_name}/{primary_key_value}
http://localhost:9925/my_table/123 (where 123 is the primary key value)Custom Resources: Custom resources are accessed via URIs defined by their registered path:
{HOST}/{path}/{resource_name}
http://localhost:9925/custom/my_resourcePOST /mcp
Sample Request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "resources/list"
}
Sample Response:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"resources": [
{
"uri": "http://localhost:9926/CustomerOrders",
"name": "CustomerOrders",
"description": "CustomerOrders table with attributes: id (PK - Int), customerId (string), customer (Relationship from customerId - Customers), itemSku (String), item (Relationship from itemSku - Items), subTotal (Float), orderTotal (Float), date (DateTime). Results can be filtered with optional query parameters.",
"mimeType": "application/json"
},
{
"uri": "http://localhost:9926/Customers",
"name": "Customers",
"description": "Customers table with attributes: id (PK - Int), email (String), phoneNumber (String), customerName (String), country (String), orders (Relationship to customerId - array). Results can be filtered with optional query parameters.",
"mimeType": "application/json"
},
{
"uri": "http://localhost:9926/Items",
"name": "Items",
"description": "Items table with attributes: sku (PK - String), itemName (String), itemDescription (String), unitPrice (Int). Results can be filtered with optional query parameters.",
"mimeType": "application/json"
},
{
"uri": "http://localhost:9926/TestCustomer",
"name": "TestCustomer",
"description": "Customers table with attributes: id (PK - Int), email (String), phoneNumber (String), customerName (String), country (String), orders (Relationship to customerId - array). Results can be filtered with optional query parameters.",
"mimeType": "application/json"
},
{
"uri": "http://localhost:9926/api/test",
"name": "test",
"description": "REST Resource.",
"mimeType": "application/json"
}
]
}
}
POST /mcp
Sample Request:
{
"jsonrpc": "2.0",
"id": 2,
"method": "resources/read",
"params": {
"uri": "http://localhost:9926/Customers"
}
}
Sample Response:
{
"jsonrpc": "2.0",
"id": 2,
"result": {
"contents": [
{
"uri": "http://localhost:9926/Customers/11",
"mimeType": "application/json",
"text": "{\"id\":11,\"email\":\"kelly.williams@example.com\",\"phoneNumber\":\"214-555-1234\",\"customerName\":\"Kelly Williams\",\"country\":\"USA\"}"
},
{
"uri": "http://localhost:9926/Customers/12",
"mimeType": "application/json",
"text": "{\"id\":12,\"email\":\"liam.martinez@example.com\",\"phoneNumber\":\"972-555-5678\",\"customerName\":\"Liam Martinez\",\"country\":\"Canada\"}"
},
{
"uri": "http://localhost:9926/Customers/13",
"mimeType": "application/json",
"text": "{\"id\":13,\"email\":\"mia.anderson@example.com\",\"phoneNumber\":\"469-555-9012\",\"customerName\":\"Mia Anderson\",\"country\":\"UK\"}"
},
{
"uri": "http://localhost:9926/Customers/14",
"mimeType": "application/json",
"text": "{\"id\":14,\"email\":\"noah.thomas@example.com\",\"phoneNumber\":\"817-555-3456\",\"customerName\":\"Noah Thomas\",\"country\":\"Australia\"}"
},
{
"uri": "http://localhost:9926/Customers/15",
"mimeType": "application/json",
"text": "{\"id\":15,\"email\":\"olivia.jackson@example.com\",\"phoneNumber\":\"682-555-7890\",\"customerName\":\"Olivia Jackson\",\"country\":\"Germany\"}"
},
{
"uri": "http://localhost:9926/Customers/16",
"mimeType": "application/json",
"text": "{\"id\":16,\"email\":\"owen.white@example.com\",\"phoneNumber\":\"214-555-2345\",\"customerName\":\"Owen White\",\"country\":\"France\"}"
},
{
"uri": "http://localhost:9926/Customers/17",
"mimeType": "application/json",
"text": "{\"id\":17,\"email\":\"sophia.harris@example.com\",\"phoneNumber\":\"972-555-6789\",\"customerName\":\"Sophia Harris\",\"country\":\"Japan\"}"
}
]
}
}
When retrieving data from tables using resources/read, you can use optional query parameters in the URI to filter data.
attribute=value pairs to filter based on column values. The comparator is always "equals".
http://localhost:9925/my_table?name=John&city=NewYorklimit and start parameters for pagination.
limit: Maximum number of results to return.start: Offset to start returning results from.http://localhost:9925/my_table?limit=10&start=20The server returns standardized JSON-RPC error responses:
{
"jsonrpc": "2.0",
"id": 2,
"error": {
"code": -32602,
"message": "Invalid params."
}
}
Error Codes:
-32601: Method not found.-32602: Invalid params.-32603: Internal server error.Please log in to share your review and rating for this MCP.
{
"mcpServers": {
"harper-mcp": {
"command": "npx",
"args": [
"-y",
"@harperdb/mcp-server"
],
"env": {}
}
}
}claude mcp add harper-mcp npx -y @harperdb/mcp-serverExplore related MCPs that share similar capabilities and solve comparable challenges
by googleapis
An MCP server that streamlines database tool development by handling connection pooling, authentication, observability, and secure access, allowing agents to interact with databases via natural language.
by bytebase
Provides a universal gateway that lets MCP‑compatible clients explore and query MySQL, PostgreSQL, SQL Server, MariaDB, and SQLite databases through a single standardized interface.
by designcomputer
Enables secure interaction with MySQL databases via the Model Context Protocol, allowing AI applications to list tables, read contents, and execute queries safely.
by benborla
Provides read‑only access to MySQL databases for large language models, allowing schema inspection and safe execution of SQL queries.
by neo4j-contrib
Enables natural‑language interaction with Neo4j databases, allowing large language models to query, modify, and manage graph data through multiple transport modes.
by mongodb-js
Provides a Model Context Protocol server that enables interaction with MongoDB databases and MongoDB Atlas clusters through a unified API.
by ClickHouse
Enables AI assistants to run read‑only ClickHouse queries, list databases and tables, and execute embedded chDB queries through an MCP interface.
by neondatabase
Interact with Neon Postgres databases using natural language commands through the Model Context Protocol, enabling conversational database creation, migration, and query execution.
by motherduckdb
Enables SQL analytics on DuckDB and MotherDuck databases via a Model Context Protocol server, allowing AI assistants and IDEs to query data directly.