Skip to content

MCP Interface

Hoard implements the Model Context Protocol (MCP) to expose tools to AI agents.

What is MCP?

MCP (Model Context Protocol) is a standard for AI agents to interact with external tools and data sources. It defines:

  • Transport — How messages are sent (HTTP, stdio)
  • Protocol — JSON-RPC 2.0
  • Tools — Functions agents can call
  • Resources — Data agents can access

Hoard’s MCP Server

Hoard runs an HTTP MCP server:

19850/mcp
hoard serve

Request Format

{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "search",
"arguments": {
"query": "meeting notes",
"limit": 10
}
}
}

Response Format

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"results": [...],
"next_cursor": "20"
}
}

The result field contains the tool response directly (not wrapped in a content array).

Available Tools

ToolScopeDescription
searchsearchHybrid search, chunks grouped by entity
getgetFull entity with all chunks
get_chunkgetSingle chunk with context
memory_getmemory.readGet stored context
memory_putmemory.writeStore context
memory_searchmemory.readSearch memory
syncsyncRun sync with lock
sync_statussyncHealth and status
sync_runsyncRun sync without lock
inbox_putingestWrite to agent inbox
agent.*variesAgent registration and management (Orchestrator)
task.*variesTask lifecycle tools (Orchestrator)
artifact.*variesTask artifacts (Orchestrator)
event.*variesEvents (Orchestrator)
cost.*variesCost tracking (Orchestrator)
workflow.*variesWorkflows (Orchestrator)

Tools NOT Exposed

For security, these tools are never exposed via MCP:

ToolReason
export_allWould enable bulk exfiltration
list_allWould enable enumeration
query(sql)Would bypass security

Tool Schemas

{
"name": "search",
"description": "Search indexed content with hybrid search",
"inputSchema": {
"type": "object",
"required": ["query"],
"properties": {
"query": {
"type": "string",
"description": "Search query"
},
"limit": {
"type": "integer",
"default": 20,
"description": "Maximum results"
},
"source": {
"type": "string",
"description": "Filter by source (e.g., 'obsidian')"
},
"cursor": {
"type": "string",
"description": "Pagination cursor from previous response"
},
"types": {
"type": "array",
"items": {"type": "string"},
"description": "Result types (entity, memory)"
},
"include_memory": {
"type": "boolean",
"description": "Deprecated. Use types instead."
}
}
}
}

get

{
"name": "get",
"description": "Get full entity content with all chunks",
"inputSchema": {
"type": "object",
"required": ["entity_id"],
"properties": {
"entity_id": {
"type": "string",
"description": "Entity UUID"
}
}
}
}

get_chunk

{
"name": "get_chunk",
"description": "Get single chunk with surrounding context",
"inputSchema": {
"type": "object",
"required": ["chunk_id"],
"properties": {
"chunk_id": {
"type": "string",
"description": "Chunk ID (format: entity_id:index)"
},
"context_chunks": {
"type": "integer",
"default": 0,
"maximum": 10,
"description": "Include N chunks before/after (0-10)"
}
}
}
}

memory_get

{
"name": "memory_get",
"description": "Retrieve stored context by key or id",
"inputSchema": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Memory id"
},
"key": {
"type": "string",
"description": "Memory key"
}
}
}
}

memory_put

{
"name": "memory_put",
"description": "Store context for later retrieval",
"inputSchema": {
"type": "object",
"required": ["key", "content"],
"properties": {
"key": {
"type": "string",
"description": "Memory key"
},
"content": {
"type": "string",
"description": "Content to store"
},
"tags": {
"type": "array",
"items": {"type": "string"},
"description": "Optional tags for categorization"
},
"metadata": {
"type": "object",
"description": "Optional metadata"
},
"ttl_days": {
"type": "integer",
"description": "Optional TTL in days"
},
"expires_at": {
"type": "string",
"description": "Optional ISO timestamp"
}
}
}
}

inbox_put

{
"name": "inbox_put",
"description": "Write content into the agent inbox",
"inputSchema": {
"type": "object",
"required": ["content"],
"properties": {
"content": {"type": "string"},
"title": {"type": "string"},
"tags": {"type": "array", "items": {"type": "string"}},
"metadata": {"type": "object"},
"filename": {"type": "string"},
"extension": {"type": "string"},
"sync_immediately": {"type": "boolean"}
}
}
}

Authentication

All requests require Bearer token authentication:

Authorization: Bearer hoard_sk_544e528b4b1ae6...

The token must:

  1. Exist in Hoard configuration
  2. Have required scope for the tool

Transport Options

HTTP (Default)

Terminal window
hoard serve
  • URL: http://127.0.0.1:19850/mcp
  • Protocol: JSON-RPC 2.0 over HTTP POST
  • Auth: Bearer token in header

Stdio (Alternative)

Terminal window
hoard mcp stdio

For MCP clients that require stdio transport.

Using with AI Agents

Claude Code

{
"mcpServers": {
"hoard": {
"url": "http://127.0.0.1:19850/mcp",
"headers": {
"Authorization": "Bearer hoard_sk_..."
}
}
}
}