Using the Skyfire MCP Server

The Skyfire MCP server enables agents to:

  • Discover sellers
  • Create kya, pay, or kya-pay tokens
  • Orchestrate agent commerce workflows

You can use it directly via JSON-RPC, or orchestrate it through an agent.

Skyfire MCP
https://mcp.skyfire.xyz/mcp

Authentication Header
skyfire-api-key: <YOUR_SKYFIRE_API_KEY>


Connect Claude Desktop to the Skyfire MCP

  1. Open your Claude Desktop configuration file, claude_desktop_config.json.
  2. Add the Skyfire MCP server:
{
  "mcpServers": {
    "skyfire": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://mcp.skyfire.xyz/mcp",
        "--header",
        "skyfire-api-key: <YOUR_SKYFIRE_API_KEY>"
      ]
    }
  }
}
  1. Restart Claude Desktop.

Your agent is now ready to discover sellers, generate kya or pay tokens, and instantly execute agentic commerce workflows!


Skyfire MCP in Action

This example demonstrates how easily an agent can orchestrate multiple MCP servers in a single workflow to conduct agentic commerce.

Using production Skyfire and Dappier MCP servers, the agent:

  1. Connects to the Skyfire MCP server to create a kya token
  2. Uses that token to authenticate with Dappier’s MCP server
  3. Purchases and retrieves real-time data

With a Skyfire API key, Dappier API key, and OpenAI API key, run this demo in one click to see a real-time data purchase.

import asyncio
import os

from agents import Agent, Runner
from agents.mcp import MCPServerStreamableHttp

# Define MCP servers
skyfire_server = MCPServerStreamableHttp(
    name="skyfire",
    params={
        "url": "https://mcp.skyfire.xyz/mcp",
        "headers": {
            "skyfire-api-key": os.getenv("SKYFIRE_API_KEY"),
        },
    },
)

dappier_server = MCPServerStreamableHttp(
    name="dappier",
    params={
        "url": f"https://mcp.dappier.com/mcp?apiKey={os.getenv('DAPPIER_API_KEY')}",
    },
)

# Define agent
agent = Agent(
    name="General purpose agent",
    mcp_servers=[skyfire_server, dappier_server],
    mcp_config={
        "convert_schemas_to_strict": True,
        "failure_error_function": None,
    },
)


async def main():
# Define agent prompt
    prompt = """
You have access to MCP tools from two servers: skyfire and dappier.

Step 1: Call the Skyfire tool that creates a KYA token.
Step 2: Using the Skyfire token, call the real-time-search Dappier tool.
- query: "Latest AI news today, include date and time"
- pass the Skyfire token as the auth credential per the tool schema.
"""
    print("\nConnecting to MCP servers (Skyfire, Dappier)...\n")
    async with skyfire_server, dappier_server:
        result = await Runner.run(agent, prompt)
        print("=== Agent run completed ===")
        print(result.final_output)

if __name__ == "__main__":
    asyncio.run(main())

After running the script, visit the Skyfire Dashboard.

You will see:

  • A newly created kya token issued for the Dappier Search Seller Service
  • The token linked to the Seller Service ID used in the demo

This confirms that:

  • The agent successfully authenticated via Skyfire
  • A real identity-enabled service interaction occurred

You can inspect the token details directly in the Dashboard for more information.



Low-Level MCP Operations

If you prefer to interact directly with the Skyfire MCP server via JSON-RPC, here are the core operations.

1. Connect

Initialize a session:

curl -i https://mcp.skyfire.xyz/mcp \
  -H "Content-Type: application/json" \
  -H "skyfire-api-key: <BUYER_AGENT_API_KEY>" \
  -H "Accept: application/json, text/event-stream" \
  -d '{
    "jsonrpc": "2.0",
    "id": "101",
    "method": "initialize",
    "params": {
      "protocolVersion": "123",
      "capabilities": {},
      "clientInfo": {
        "name": "curl",
        "version": "1.0"
      }
    }
  }'

Extract the mcp-session-id header from the response. Use this header for all subsequent calls:

mcp-session-id: <SESSION_ID>


2. List tools (Optional)

curl -X POST https://mcp.skyfire.xyz/mcp \
  -H "Content-Type: application/json" \
  -H "skyfire-api-key: <BUYER_AGENT_API_KEY>" \
  -H "mcp-session-id: <SESSION_ID>" \
  -H "Accept: application/json, text/event-stream" \
  -d '{
    "jsonrpc": "2.0",
    "id": "103",
    "method": "tools/list",
    "params": {}
  }'

3. Call tools

find-sellers

curl -X POST https://mcp.skyfire.xyz/mcp \
  -H "Content-Type: application/json" \
  -H "skyfire-api-key: <BUYER_AGENT_API_KEY>" \
  -H "mcp-session-id: <SESSION_ID>" \
  -H "Accept: application/json, text/event-stream" \
  -d '{
    "jsonrpc": "2.0",
    "id": "104",
    "method": "tools/call",
    "params": {
      "name": "find-sellers",
      "arguments": { "search": "" }
    }
  }'

create-kya-token

curl -X POST https://mcp.skyfire.xyz/mcp \
  -H "Content-Type: application/json" \
  -H "skyfire-api-key: <BUYER_AGENT_API_KEY>" \
  -H "mcp-session-id: <SESSION_ID>" \
  -H "Accept: application/json, text/event-stream" \
  -d '{
    "jsonrpc": "2.0",
    "id": "105",
    "method": "tools/call",
    "params": {
      "name": "create-kya-token",
      "arguments": {
        "sellerServiceId": "<SELLER SERVICE ID>"
      }
    }
  }'

create-pay-token

curl -X POST https://mcp.skyfire.xyz/mcp \
  -H "Content-Type: application/json" \
  -H "skyfire-api-key: <BUYER_AGENT_API_KEY>" \
  -H "mcp-session-id: <SESSION_ID>" \
  -H "Accept: application/json, text/event-stream" \
  -d '{
    "jsonrpc": "2.0",
    "id": "106",
    "method": "tools/call",
    "params": {
      "name": "create-pay-token",
      "arguments": {
        "amount": "<AMOUNT_IN_USD>",
        "sellerServiceId": "<SELLER_SERVICE_ID>"
      }
    }
  }'

create-kya-payment-token

curl -X POST https://mcp.skyfire.xyz/mcp \
  -H "Content-Type: application/json" \
  -H "skyfire-api-key: <BUYER_AGENT_API_KEY>" \
  -H "mcp-session-id: <SESSION_ID>" \
  -H "Accept: application/json, text/event-stream" \
  -d '{
    "jsonrpc": "2.0",
    "id": "106",
    "method": "tools/call",
    "params": {
      "name": "create-kya-payment-token",
      "arguments": {
        "amount": "<AMOUNT_IN_USD>",
        "sellerServiceId": "<BUYER_AGENT_API_KEY>"
      }
    }
  }'