MCP Server

zing mcp serve starts an MCP server over stdio that AI agents (Claude Desktop, Cursor, Codex, etc.) can connect to as a subprocess. The server provides three tools.

Prerequisites

Install the zing CLI first — see the CLI page for installation, configuration, and wallet setup.


Client Setup

Claude Desktop — add to claude_desktop_config.json:

{
  "mcpServers": {
    "zing": {
      "command": "zing",
      "args": ["mcp", "serve"]
    }
  }
}

Cursor — add to .cursor/mcp.json:

{
  "mcpServers": {
    "zing": {
      "command": "zing",
      "args": ["mcp", "serve"]
    }
  }
}

With API override:

{
  "command": "zing",
  "args": ["mcp", "serve", "--api", "https://staging.api.com"]
}

Description:

Search the Zing decentralized knowledge base. Provide short keyword queries (2-4 words preferred). Returns articles with relevance scores, excerpts, tags, and budget info. Default limit is 20.

Parameters:

ParamTypeRequiredDefaultDescription
qstringyesSearch query (compact keywords preferred)
ownerstringnonullFilter to specific creator's wiki address
limitintno20Max results (capped at 50)

Response fields:

FieldTypeDescription
results[].article_idstringOn-chain article address
results[].titlestringArticle title
results[].excerptstring or nullBest-matching text snippet
results[].heading_pathstring[]Heading hierarchy for the match
results[].scorefloatRelevance score (cross-encoder reranked)
results[].article_token_countintTotal tokens in the article
results[].recency_daysintDays since last index
results[].tagsstring[]Extracted topic tags
budget.paid_usdcstringTotal USDC sent (in micro-USDC)
budget.consumed_usdcstringUSDC consumed by this request
budget.remaining_usdcstringUSDC remaining after this request

Tool: zing_chunks

Description:

Retrieve raw text segments from search results with per-chunk pricing. Provide short keyword queries. Returns chunks with text, scores, content_type, and truncation metadata. Set expand=true (no extra cost) to return full text instead of excerpts. Use article_ids to filter to specific articles. When truncation metadata is present, call zing_expand_chunks with those chunk_ids to retrieve full text. Default limit is 20.

Parameters:

ParamTypeRequiredDefaultDescription
qstringyesSearch query (compact 2-4 word keywords)
ownerstringnonullFilter to specific creator's wiki address
limitintno20Max results (capped at 50)
expandboolnofalseReturn full untruncated text instead of excerpts (no extra cost)
article_idsstring[]nonullFilter to specific article IDs

Response fields:

FieldTypeDescription
chunks[].chunk_idintUnique chunk identifier
chunks[].article_idstringOn-chain article address
chunks[].titlestringArticle title
chunks[].textstringChunk text (excerpt or full if expand=true)
chunks[].scorefloatBlended relevance score
chunks[].chunk_token_countintEstimated tokens in this chunk
chunks[].heading_pathstring[]Heading hierarchy
chunks[].content_typestring"prose", "code", or "table"
chunks[].languagestring or nullProgramming language for code chunks
chunks[].truncatedobject or nullTruncation metadata (see below)
budget.*stringSame structure as zing_search

Truncation workflow:

zing_chunks → chunk.truncated is non-null → zing_expand_chunks(chunk_ids) → full text

Tool: zing_expand_chunks

Description:

Expand truncated chunks to retrieve full untruncated text. Pass chunk_ids from chunks results that have non-null truncated fields. Max 20 chunk IDs per call.

Parameters:

ParamTypeRequiredDefaultDescription
chunk_idsint[]yesChunk IDs to expand (max 20)

Response fields:

FieldTypeDescription
chunks[].chunk_idintChunk identifier
chunks[].article_idstringOn-chain article address
chunks[].heading_pathstring[]Heading hierarchy
chunks[].chunk_textstringFull untruncated chunk content
chunks[].content_typestring"prose", "code", or "table"
chunks[].token_countintEstimated tokens
chunks[].truncatedobject or nullTruncation metadata (always non-null for expand)
budget.*stringSame structure as zing_search

Next Steps

  • CLI - Install and use the zing CLI
  • Search API - Explore the search and chunk API endpoints
  • Pay-Per-Query API - Learn about per-chunk token-based pricing

Was this page helpful?