docs-mcp

v5.4.8
@one-source/docs-mcp Checked 3 days ago Published 16 days ago

MCP server for OneSource REST API documentation: search docs, list endpoints, look up parameters and payment info, find endpoints by use case

@one-source/docs-mcp Give your AI assistant full access to the OneSource REST API documentation: search the docs, list endpoints, look up parameters and payment info, and find endpoints by use case. > This is the docs-only server: the assistant can *read* about the OneSource REST API, with no auth, no payment, and no wallet. @one-source/mcp carries these same eight tools alongside the ones that *call* the API for real EVM chain reads, so reach for this package when you want the documentation on its own.

Summary extracted from the README.

@one-source/docs-mcp

npm version License: MIT Node >= 18

Give your AI assistant full access to the OneSource REST API documentation: search the docs, list endpoints, look up parameters and payment info, and find endpoints by use case.

This is the docs-only server: the assistant can read about the OneSource REST API, with no auth, no payment, and no wallet. @one-source/mcp carries these same eight tools alongside the ones that call the API for real EVM chain reads, so reach for this package when you want the documentation on its own.

Quick Start

Remote (zero setup)

Point any MCP client at the hosted endpoint, no install required:

https://docs.onesource.io/api/mcp

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "onesource-docs": {
      "command": "npx",
      "args": ["-y", "@one-source/docs-mcp"]
    }
  }
}

Claude Code

claude mcp add onesource-docs -- npx -y @one-source/docs-mcp

Any MCP Client (stdio)

npx -y @one-source/docs-mcp

HTTP Server (self-hosted)

npx -y @one-source/docs-mcp --http
npx -y @one-source/docs-mcp --http --port=8080

Then connect your MCP client to http://localhost:3001/mcp.

Tools

All eight tools are prefixed 1s_ so they sort together in your client. No API key required: the bundled data is read-only.

Tool Purpose When to use
1s_search_docs Keyword search across all OneSource docs (intro, getting-started, guides) "Find sections about rate limits", "Where's the response envelope documented?"
1s_get_api_overview Operation count, tags, networks, payment protocols, sample endpoints First call when exploring the API surface
1s_list_endpoints List endpoints with method, path, price, summary (optional tag filter) "Show me all NFT endpoints", "What's available under the erc20 tag?"
1s_get_endpoint_reference Full reference for one endpoint: parameters, request body, example response, payment, use cases, curl "How do I call /api/chain/nft-metadata?"
1s_search_use_cases Find endpoints by natural-language description "I want to check NFT ownership", "Decode a transaction receipt"
1s_list_networks Networks the API routes, read from the spec Verifying multi-network support
1s_get_payment_info x402 / MPP protocols, prices, pay-to addresses (global or per endpoint) Understanding the payment model before integrating
1s_get_authentication_guide Bearer / x402 / MPP auth: code examples and when to use which First-time setup

Examples

// "What's the price range for paid endpoints?"
{ "tool": "1s_get_payment_info" }

// "Show me the NFT-related endpoints"
{ "tool": "1s_list_endpoints", "args": { "tag": "nft" } }

// "How does live-balance work?"
{ "tool": "1s_get_endpoint_reference", "args": { "endpoint": "chainLiveBalance" } }

// "I want to check if a wallet has approved a DEX"
{ "tool": "1s_search_use_cases", "args": { "query": "ERC20 approval audit" } }

Programmatic use

The package also ships as a library, so you can mount the same server inside your own process (a serverless function, an existing HTTP app, a test harness):

import { createMcpServer, loadData, VERSION } from '@one-source/docs-mcp';

// Load the bundled data once, then create a server per request (stateless HTTP)
const data = loadData();
const { server, analytics } = createMcpServer({ data, transport: 'http' });
Import Exposes
@one-source/docs-mcp createMcpServer, loadData, VERSION, StreamableHTTPServerTransport, and the CreateServerOptions / CreateServerResult / LoadedData types
@one-source/docs-mcp/analytics createAnalytics and the Analytics / AnalyticsEvent / ToolCallEvent / ServiceEvent types
@one-source/docs-mcp/types ContentSection, SearchResult, ApiData, ApiParameter, and the rest of the shared data shapes
@one-source/docs-mcp/content/loader loadContent
@one-source/docs-mcp/content/indexer SearchIndex
@one-source/docs-mcp/content/api-loader loadApiData
@one-source/docs-mcp/tools/<tool> Per-tool <name>Schema (Zod) and handle<Name> for the eight tools, if you want to register them on a server of your own

createMcpServer({ data }) accepts either a directory path or a pre-loaded LoadedData; omit it and the bundled data/ directory is used.

What ships in the package

Two data artifacts are bundled, so there are no network calls at runtime:

  • data/api-data.json: a flattened view of the OneSource OpenAPI 3.1 spec (operations, parameters, prices, payment protocols, networks).
  • data/docs/: the Markdown sources of https://docs.onesource.io, excluding the generated endpoint reference (that information is served by the tools above).

Both are committed, and publishing is gated on them being current: the release fails if data/docs/ has drifted from the documentation sources, or if data/api-data.json no longer matches the pinned OpenAPI snapshot it was generated from. So a published version carries the corpus that its own commit describes.

License

MIT. See LICENSE.