Harper MCP Server for HarperDB Resources
Expose HarperDB data as structured Resources with an MCP server using standardized JSON-RPC calls for seamless integration and API access.
npx -y @HarperDB/mcp-serverOverview
The Harper MCP Server implements the Model Context Protocol (MCP) for HarperDB, exposing HarperDB tables and custom endpoints as structured “Resources” over a JSON-RPC API. It translates HarperDB data into a predictable, discoverable resource surface that other services and tools can consume without needing direct database drivers or custom REST adapters.
This server is useful when you want standardized, read-oriented access to HarperDB from external systems (UIs, integrations, indexing services, or other microservices). It provides a consistent discovery mechanism (resource listing) and read endpoints with support for filtering and pagination, while leveraging HarperDB’s existing authentication and role-based access controls.
Features
- MCP-compatible JSON-RPC endpoint for listing and reading resources
- Exposes HarperDB tables and custom-defined resources as discoverable URIs
- Read-only access to table data and individual rows
- Query/filter support for table reads via URL-style parameters
- Pagination with
limitandstartparameters - Predefined static capabilities endpoint (
/capabilities.json) - Standardized JSON-RPC 2.0 error responses
- Integrates with HarperDB authentication (Basic Auth, JWT, mTLS) and role/attribute-level security
Installation / Configuration
Prerequisites:
- Harper platform installed and running (HarperDB v4.5.10 or later).
- Harper stacks configured with the databases/schemas you plan to expose.
- Set the
HOSTenvironment variable to the base URL used to construct resource URIs.
Install / deploy to Harper via the Harper Operations API (example):
POST https://harper-server.example:9925
Content-Type: application/json
{
"operation": "deploy_component",
"package": "@harperdb/mcp-server@latest"
}
Environment variables (example):
# Other Harper environment settings as required by your deployment
Local development (npm):
# run according to the package's README or container image in Harper
Security & authentication:
- The server relies on HarperDB’s authentication mechanisms. Configure Basic Auth, JWT, or mTLS in Harper to secure requests.
- Harper’s role-based and attribute-level security determines which records/fields each caller can access; the MCP server enforces those Harper-level permissions.
Available Resources
MCP endpoint:
- Single JSON-RPC endpoint: POST /mcp
- Static capabilities: GET /capabilities.json
MCP methods:
| Method | Description | Params | Returns | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| resources/list | Discover all resources (tables & custom resources) | none | Array of resource metadata (uri, name, description, mimeType) | ||||||||||||
| resources/read | Read contents of a specific resource | { uri: “| contents array with item URIs and payloads | Resource URI patterns:
Capabilities endpoint example: Use Cases
Error Handling & Notes
Repository and further reference:
|