Skip to main content
The Graphor MCP Server lets AI agents — such as Cursor, VS Code Copilot, Claude Code, and other MCP-compatible clients — interact with your Graphor project directly. Your agent can upload documents, ask questions, extract structured data, and perform semantic search, all without leaving your development environment.

Ingest & Manage

Ingest files, URLs, GitHub repos, and YouTube videos; poll build status for file_id

Chat & Ask

Ask questions about your documents with conversational memory

Extract Data

Extract structured data from documents using JSON Schema

Semantic Search

Retrieve relevant document chunks for custom RAG pipelines

How It Works

The Graphor MCP Server exposes 12 individual tools, one per SDK operation. Each tool maps directly to a Graphor API call and your agent calls them by name with typed parameters. The ingestion tools (ingest_file, ingest_url, ingest_github, ingest_youtube, and reprocess) are asynchronous: they return a build_id immediately, and you poll get_build_status until the job completes to obtain the file_id. All other operations (ask, extract, retrieve_chunks, get_elements, delete_source, list_sources) use file_id directly.

Installation

Prerequisites

Quick Start with npx

You can run the MCP Server directly via npx without installing anything:
export GRAPHOR_API_KEY="grlm_your_api_key_here"
npx -y graphor-mcp@latest

Setup by Client

Cursor

Install the MCP server directly in Cursor using the button below: Add to Cursor Or manually add it to your Cursor mcp.json (found in Cursor Settings > Tools & MCP > New MCP Server):
{
  "mcpServers": {
    "graphor_api": {
      "command": "npx",
      "args": ["-y", "graphor-mcp@latest"],
      "env": {
        "GRAPHOR_API_KEY": "grlm_your_api_key_here"
      }
    }
  }
}

VS Code

Install the MCP server in VS Code by clicking the link below: Install Graphor MCP for VS Code Or manually add it to your VS Code mcp.json (found via Command Palette > MCP: Open User Configuration):
{
  "mcpServers": {
    "graphor_api": {
      "command": "npx",
      "args": ["-y", "graphor-mcp@latest"],
      "env": {
        "GRAPHOR_API_KEY": "grlm_your_api_key_here"
      }
    }
  }
}

Claude Code

Install the MCP server for Claude Code by running the following command in your terminal:
claude mcp add graphor_mcp_api --env GRAPHOR_API_KEY="grlm_your_api_key_here" -- npx -y graphor-mcp
You can also manually configure it in your .claude.json file (found in your home directory).

Other MCP Clients

For any MCP-compatible client, use the following configuration:
{
  "mcpServers": {
    "graphor_api": {
      "command": "npx",
      "args": ["-y", "graphor-mcp@latest"],
      "env": {
        "GRAPHOR_API_KEY": "grlm_your_api_key_here"
      }
    }
  }
}
See the full list of MCP-compatible clients at modelcontextprotocol.io/clients.

Remote MCP Server

For web-based AI clients (e.g. Claude.ai) or agentic frameworks (e.g. LangChain, CrewAI) that cannot run local npx processes, use the hosted remote MCP server. Authentication is handled via OAuth — a browser window will open for you to log in. Server URL:
https://mcp.graphor.workers.dev/sse

Claude.ai

  1. Go to Settings > Connectors > Add custom connector
  2. Fill in the Name (e.g. “Graphor”)
  3. Set the Remote MCP server URL to:
https://mcp.graphor.workers.dev/sse
  1. You will be redirected to log in through the OAuth flow
  2. Once authenticated, Graphor tools will be available in your conversations

Claude Desktop (Remote)

Add the following to your Claude Desktop configuration file (Settings > Developer > Edit Config):
{
  "mcpServers": {
    "graphor_api": {
      "command": "npx",
      "args": ["mcp-remote", "https://mcp.graphor.workers.dev/sse"]
    }
  }
}
When you open Claude Desktop, a browser window will open for you to log in. After authenticating, the Graphor tools will appear in the bottom right of your conversation.

Cursor (Remote)

Add the following to your Cursor MCP configuration (Cursor Settings > Tools & MCP > New MCP Server):
{
  "mcpServers": {
    "graphor_api": {
      "command": "npx",
      "args": ["mcp-remote", "https://mcp.graphor.workers.dev/sse"]
    }
  }
}

Agentic Workflows (LangChain, CrewAI, etc.)

For agentic frameworks that support MCP, connect to the remote server via SSE transport: LangChain (Python):
from langchain_mcp_adapters.client import MultiServerMCPClient

async with MultiServerMCPClient(
    {
        "graphor": {
            "url": "https://mcp.graphor.workers.dev/sse",
            "transport": "sse",
        }
    }
) as client:
    tools = client.get_tools()
    # Use tools with your LangChain agent
LangChain (TypeScript):
import { MultiServerMCPClient } from "@langchain/mcp-adapters";

const client = new MultiServerMCPClient({
  graphor: {
    url: "https://mcp.graphor.workers.dev/sse",
    transport: "sse",
  }
});

const tools = await client.getTools();
// Use tools with your LangChain agent

Any MCP-compatible Client (Remote)

For any client that supports remote MCP servers via SSE, use the URL:
https://mcp.graphor.workers.dev/sse
For clients that only support stdio transport, use mcp-remote as a bridge:
{
  "mcpServers": {
    "graphor_api": {
      "command": "npx",
      "args": ["mcp-remote", "https://mcp.graphor.workers.dev/sse"]
    }
  }
}
The OAuth flow will open a browser window on first connection. For headless environments, you may need to complete the OAuth flow beforehand or use mcp-remote as a local proxy.

Available Tools

Once installed, your agent has access to 12 tools covering the full Graphor API surface:

Ingestion

ToolRequired paramsOptional paramsReturns
ingest_filefile_path or (file_content + file_name)methodbuild_id
ingest_urlurlcrawlUrls, methodbuild_id
ingest_githuburlbuild_id
ingest_youtubeurlbuild_id
get_build_statusbuild_idsuppress_elements, suppress_img_base64, page, page_sizebuild status + file_id when complete. Status can be Pending (not started), Processing, Completed, or Processing failed
The method parameter controls the partitioning strategy: fast, balanced, accurate, vlm, or agentic.

Source Management

ToolRequired paramsOptional paramsReturns
list_sourcesfile_idslist of sources with metadata
reprocessfile_idmethodbuild_id
get_elementsfile_idpage, page_size, suppress_img_base64, type, page_numbers, elementsToRemovepaginated elements
delete_sourcefile_idconfirmation

Chat, Extraction & RAG

ToolRequired paramsOptional paramsReturns
askquestionfile_ids, file_names, conversation_id, reset, output_schema, thinking_levelanswer + conversation_id
extractuser_instruction, output_schemafile_ids, file_names, thinking_levelstructured_output
retrieve_chunksqueryfile_ids, file_namesranked text chunks

What Your Agent Can Do

With the MCP server, your agent can perform any operation available in the Graphor API:
Use ingest_file, ingest_url, ingest_github, or ingest_youtube to add sources. Each returns a build_id immediately — poll get_build_status to track progress and retrieve the file_id when processing completes.Example agent prompts:Tool flow:
  1. Call ingest_file (or ingest_url / ingest_github / ingest_youtube) → receive build_id
  2. Call get_build_status with build_id repeatedly until success: true. Status may be Pending (request received, build not started), then Processing, then Completed.
  3. Use the returned file_id for all subsequent operations
Use list_sources to see all ingested documents with their file_id, file_name, status, and metadata. Use delete_source to permanently remove a source by file_id.Example agent prompts:
  • “List all my sources and show their status.”
  • “Find the file_id for the document named ‘Q3 Report’.”
  • “Delete the source with file_id file_abc123.”
Use reprocess to re-run the ingestion pipeline on an existing source with a different partitioning strategy. Returns a build_id — poll get_build_status as usual.Example agent prompts:
  • “Reprocess file_abc123 using the ‘agentic’ method for better accuracy.”
  • “Re-parse this PDF with the ‘vlm’ method to extract tables better.”
Available methods: fast, balanced, accurate, vlm, agentic
Use get_elements to retrieve the structured chunks/partitions of a processed source. Filter by element type, page numbers, or exclude unwanted types.Example agent prompts:
  • “Get the first 20 elements of file_abc123.”
  • “Show only the ‘Table’ elements from file_abc123.”
  • “Get elements from pages 3 to 5 of file_abc123.”
Use ask to pose natural-language questions about your sources. Maintain conversation memory by passing the conversation_id returned in each response. Scope to specific files using file_ids.Example agent prompts:
  • “Ask: what are the key findings in the ingested report?”
  • “Follow up: can you elaborate on the second finding?”
  • “Ask a question scoped to file_ids [‘file_abc123’, ‘file_def456’].”
Use extract to pull typed data from documents by providing a natural-language instruction and a JSON Schema defining the output shape.Example agent prompts:
  • “Extract the invoice number and total amount from file_abc123.”
  • “From the contract, extract the parties, start date, and renewal terms.”
Example schema:
{
  "type": "object",
  "properties": {
    "invoice_number": { "type": "string" },
    "total_amount": { "type": "number" }
  },
  "required": ["invoice_number", "total_amount"]
}
Use retrieve_chunks to find the most relevant text chunks for a query without generating an answer. Useful for building custom RAG pipelines or inspecting what context the model would use.Example agent prompts:
  • “Find chunks about payment terms in file_abc123.”
  • “Search across all sources for mentions of ‘data retention policy’.”

Running Remotely

You can run the MCP server as a remote HTTP server using Streamable HTTP transport:
export GRAPHOR_API_KEY="grlm_your_api_key_here"
npx -y graphor-mcp@latest --transport=http --port=3000
FlagDescription
--transport=httpEnables remote HTTP mode (Streamable HTTP transport)
--port=<number>Port to listen on (e.g., 3000)
--socket=<path>Run on a Unix socket instead of a TCP port

Authentication for Remote Mode

Authorization can be provided via the Authorization header using the Bearer scheme, or via the x-graphor-api-key header:
HeaderEquivalent Client OptionSecurity Scheme
x-graphor-api-keyapiKeyHTTPBearer

Remote Client Configuration

For clients connecting to a remote server (e.g., hosted at http://localhost:3000):
{
  "mcpServers": {
    "graphor_api": {
      "url": "http://localhost:3000",
      "headers": {
        "Authorization": "Bearer grlm_your_api_key_here"
      }
    }
  }
}

Troubleshooting

Causes: Missing or invalid API keySolutions:
  • Verify your GRAPHOR_API_KEY is set correctly in the MCP configuration
  • Ensure the key starts with grlm_
  • Generate a new key in the Graphor dashboard
Causes: Node.js not installed, npx not available, or network issuesSolutions:
  • Verify Node.js 20+ is installed: node --version
  • Ensure npx is available: npx --version
  • Try running the server manually first: npx -y graphor-mcp@latest
  • Check your MCP client logs for error messages
Causes: Server crashed or timed outSolutions:
  • Restart your MCP client
  • Check if another process is using the same port (remote mode)
  • Try a fresh install: npx -y graphor-mcp@latest
Causes: Invalid code or SDK usageSolutions:
  • Ask the agent to use the search_docs tool first to check the correct method signatures
  • Ensure your documents have been uploaded and processed before querying
  • Check that file names and IDs match what is in your project

Next Steps

SDK Overview

Learn the full SDK API that your agent can use via the MCP server

Ingest Sources

Detailed guide on ingesting documents, URLs, GitHub repos, and videos

Chat with Documents

Ask questions and have conversations about your documents

Data Extraction

Extract structured data from documents with JSON Schema