Skip to content

Use GraphOps with AI agents

Paste one prompt into your coding agent to install the GraphOps skills, connect the docs MCP server and make a first working RPC, Subgraphs or Substreams request.

Help your coding agent write working code against GraphOps on the first attempt. GraphOps publishes agent skills, short instructions your agent loads when a task needs them, an MCP server for the documentation, and MCP servers that read RPC and Subgraphs data. The skills tell the agent which service fits a task, how to authenticate, how to keep requests bounded and what to do when a request fails.

Set up your project

You need a coding agent that can read web pages and run commands, such as Claude Code, and a GraphOps account with credits. Paste this prompt into your agent from your project's directory:

Set up GraphOps in this project. Read https://docs.graphops.xyz/AGENTS.md and follow its steps to set up a project. Ask me before you install anything. I'll set API keys myself, so don't ask me to paste one into this conversation.

Your agent reads https://docs.graphops.xyz/AGENTS.md and works through its setup steps with you:

  1. It asks what data your application needs and on which networks.
  2. It installs the GraphOps skills and connects the docs MCP server, after asking you.
  3. It recommends RPC, Subgraphs or Substreams and checks that the service supports your networks.
  4. It adds the API key variable your project needs and waits while you create a key in API keys and set the variable.
  5. It writes a first request in your project's language, runs it and shows you the data with the block it was read at.

Requests your agent sends use credits like any other request. When a request fails later, paste the error into the conversation: the skills send your agent to the error reference, and tell it to stop instead of retrying when the key or credits are the cause.

Connect your agent yourself

To install the skills and connect the docs MCP server without the prompt, run the commands for your agent:

Install the skills

npx skills add https://docs.graphops.xyz

Connect the docs MCP server

claude mcp add --transport http graphops-docs https://docs.graphops.xyz/api/mcp

If your agent doesn't list the docs tools after you connect the server, start a new session.

Install the skills

GraphOps publishes these skills:

SkillLoads when a task
graphopsChooses between services, uses an API key, or explains an error code.
graphops-rpcReads chain state, calls contracts, fetches logs or submits transactions.
graphops-subgraphsQueries indexed entities with GraphQL.
graphops-substreamsStreams blocks or module output, backfills a range, or runs a sink.
graphops-cliUses the GraphOps CLI to deploy, manage keys and Endpoint Aliases, or read usage, as you.

The skills are listed at https://docs.graphops.xyz/.well-known/agent-skills/index.json, the Agent Skills Discovery(opens in a new tab) location that skill installers read. To install them all with the open-source skills installer, run npx skills add https://docs.graphops.xyz. With the GraphOps CLI installed, graphops agent-skills install installs them for the coding agents on your machine, checks each download, and graphops agent-skills update keeps them current.

You can also download one skill from https://docs.graphops.xyz/.well-known/agent-skills/<name>/SKILL.md and save it where your agent reads skills. For example, Claude Code reads ~/.claude/skills/<name>/SKILL.md.

An agent that doesn't support skills can still read https://docs.graphops.xyz/skill.md, the general skill, as plain instructions.

The skills contain instructions and links only, never scripts.

Install the Claude Code plugins

In Claude Code, the GraphOps plugins install the skills together with the MCP servers that go with them, and update when the skills change. Add the GraphOps marketplace with /plugin marketplace add graphops/claude-agent-plugins, then install the plugins your project needs, for example /plugin install graphops-rpc@graphops.

PluginContains
graphopsThe graphops skill and the docs MCP server. Every other plugin installs it too.
graphops-rpcThe graphops-rpc skill and the RPC MCP server.
graphops-subgraphsThe graphops-subgraphs skill and the Subgraphs MCP server.
graphops-substreamsThe graphops-substreams skill.
graphops-platformThe graphops-cli skill, for managing platform resources with the GraphOps CLI. Install the CLI and sign it in yourself; Claude asks before any command that deploys, promotes, creates or removes a key or alias, or spends credits.

When you install graphops-rpc or graphops-subgraphs, Claude Code asks for a query key that includes that service, without limits on networks or Subgraphs, and keeps it in your system's credential store. It sends the key only to that service's MCP server. One key that includes both services works for both plugins. The plugins are generated from these docs, and their source is public at github.com/graphops/claude-agent-plugins(opens in a new tab).

Install the Codex plugins

The same plugins are available for Codex. Add the GraphOps marketplace with codex plugin marketplace add graphops/openai-agent-plugins, then install the plugins your project needs, for example codex plugin add graphops-rpc@graphops. Codex plugins can't depend on each other, so every plugin includes the graphops skill.

The graphops plugin connects the docs MCP server. Codex plugins can't pass an API key to an MCP server, so the graphops-rpc and graphops-subgraphs plugins install the skill only. Connect the RPC and Subgraphs MCP servers with the Codex commands in Query data through MCP, which read a query key without limits from GRAPHOPS_API_KEY each time Codex connects. With the GraphOps CLI installed, start Codex with graphops exec --product rpc codex instead of setting the variable, with one --product for each service you connected. It checks that your organization's stored key includes those services and sets GRAPHOPS_API_KEY for that Codex session only.

Give the agent an API key

The skills read the key from an environment variable, so the key never has to appear in the conversation: GRAPHOPS_API_KEY, which the code examples also read, or SUBSTREAMS_API_KEY for the Substreams CLI and its sinks. With the GraphOps CLI, the agent runs its code with graphops exec, which sets the variables from your organization's stored key.

Create a separate key for the environment your agent works in, with a label that names it, so you can revoke it without affecting your applications. The skills tell the agent to stop on credits_exhausted instead of retrying; to keep an agent's usage in check, set a spending limit on automatic top-ups and watch usage.

See API keys to create and revoke keys.

Read pages as Markdown

An agent that fetches pages directly can read them without HTML. Every docs page and every graphops.xyz page answers a request with Accept: text/markdown with its Markdown, served as text/markdown; browsers still get HTML. You can also add .md to a docs page path, such as https://docs.graphops.xyz/ai-agents.md. https://docs.graphops.xyz/llms.txt and https://graphops.xyz/llms.txt list every page.

Connect the docs MCP server

The docs MCP server lets an agent search and read these docs, explain an error code, and list the supported networks with their endpoints, without leaving its session. It needs no API key.

ToolUse
searchSearch the docs.
list_pagesList every docs page.
get_pageRead one page in Markdown.
explain_errorExplain an error code and what to do next.
list_networksList each service's supported networks and endpoints.

The server is https://docs.graphops.xyz/api/mcp, using the Streamable HTTP transport. Connect your agent yourself has the command for each agent.

Query data through MCP

RPC and Subgraphs each serve an MCP server, so your agent can read chain data and query Subgraphs from its session, without writing and running code first. Use them to explore and answer questions; the code your application runs still calls the service's endpoints.

ServerURL
RPChttps://rpc.graphops.xyz/v1/mcp
Subgraphshttps://subgraphs.graphops.xyz/v1/mcp

Both use the Streamable HTTP transport and take the same API key as the service's endpoints, sent as Authorization: Bearer <key>. Create a key with access to RPC, Subgraphs or both, and without limits on networks or Subgraphs: a tool call names its network or Subgraph in its arguments, not in the URL, so a limited key is refused. Set the key as GRAPHOPS_API_KEY, then add the servers for your agent:

Add to .mcp.json in your project

{
  "mcpServers": {
    "graphops-rpc": {
      "type": "http",
      "url": "https://rpc.graphops.xyz/v1/mcp",
      "headers": {
        "Authorization": "Bearer ${GRAPHOPS_API_KEY}"
      }
    },
    "graphops-subgraphs": {
      "type": "http",
      "url": "https://subgraphs.graphops.xyz/v1/mcp",
      "headers": {
        "Authorization": "Bearer ${GRAPHOPS_API_KEY}"
      }
    }
  }
}
ServerToolsReference
RPCevm_rpc and bitcoin_rpc read chain data; evm_send_raw_transaction and bitcoin_send_raw_transaction broadcast transactions you have signed.RPC MCP server
Subgraphssubgraph_get_schema, subgraph_get_meta and subgraph_query read a Subgraph's schema, indexed block and data.Subgraphs MCP server

Every result states the block it reflects. GraphOps never signs transactions or holds keys: the send tools only relay a transaction you have signed, and agents mark them as tools that change state, so most agents ask you before running one.

Each tool call is one request to the service and uses credits like the same request sent to its endpoint. A call GraphOps refuses, a result over the size limit and a node's own refusal aren't billed. Tool errors tell the agent whether to change its arguments, ask for less, retry later or stop. Each server's page covers its tools' arguments, results, errors and limits. In Claude Code, the graphops-rpc and graphops-subgraphs plugins connect these servers for you; Codex plugins can't, so connect them yourself.

Keep the skills current

Each skill states its version and the URL it was published at, and tells the agent to compare its copy with the published one at the start of a task. When your agent reports that your GraphOps skills are out of date, install them again. Claude Code updates the GraphOps plugins with /plugin update, or on its own when you turn on auto-update for the graphops marketplace. Codex updates them with codex plugin marketplace upgrade graphops.

An agent that starts from a service endpoint can find that service's skill in the service's RFC 9727(opens in a new tab) API catalog at /.well-known/api-catalog, and in the merged catalog at https://graphops.xyz/.well-known/api-catalog. No registered link relation names an agent skill yet, so the catalog entry links the skill's SKILL.md with the extension relation https://docs.graphops.xyz/ai-agents#skill-link-relation and the type text/markdown.

Next steps

Last updated