Skip to main content
Glama

故事 MCP 中心

该存储库是 Story Protocol 模型上下文协议 (MCP) 服务器的中心枢纽。它为运行和管理各种 MCP 服务提供了统一的环境,使 AI 代理能够与 Story Protocol 的生态系统进行交互。

项目结构

story-mcp-hub/
├── storyscan-mcp/       # MCP server for blockchain data queries via StoryScan
├── story-sdk-mcp/       # MCP server for Story Protocol SDK interactions
├── utils/               # Shared utilities for MCP servers
├── .venv/               # Python virtual environment
├── pyproject.toml       # Project dependencies and configuration
├── .python-version      # Python version specification
└── README.md            # This file
graph TD
    subgraph "MCP Hub"
        style MCP Hub fill:#F5F5FF,stroke:#9999CC,stroke-width:2px,rx:10,ry:10
        Agent["AI Agent<br>(Claude, IDEs, Tools)"]
        style Agent fill:#E6E6FA,stroke:#9370DB,stroke-width:2px,rx:8,ry:8
    end

    subgraph "StoryScan MCP Server"
        style StoryScan MCP Server fill:#F0F8FF,stroke:#87CEFA,stroke-width:2px,rx:10,ry:10
        StoryscanService["StoryScan Service"]
        style StoryscanService fill:#E6E6FA,stroke:#9370DB,stroke-width:2px,rx:8,ry:8

        subgraph "StoryScan Tools"
            style StoryScan Tools fill:#F0FFFF,stroke:#5F9EA0,stroke-width:2px,rx:10,ry:10
            StoryscanToolset["Balance & Stats<br>check_balance,<br>get_address_overview,<br>get_transactions,<br>interpret_transaction,<br>get_token_holdings,<br>get_nft_holdings,<br>get_stats"]
            style StoryscanToolset fill:#E0FFFF,stroke:#5F9EA0,stroke-width:2px,rx:8,ry:8
        end
    end

    subgraph "Story SDK MCP Server"
        style Story SDK MCP Server fill:#F5FFFA,stroke:#98FB98,stroke-width:2px,rx:10,ry:10
        StoryService["Story Service"]
        style StoryService fill:#E6E6FA,stroke:#9370DB,stroke-width:2px,rx:8,ry:8

        subgraph "Story SDK Tools"
            style Story SDK Tools fill:#F0FFF0,stroke:#90EE90,stroke-width:2px,rx:10,ry:10
            IPFSTools["IPFS Tools<br>upload_image_to_ipfs<br>create_ip_metadata"]
            style IPFSTools fill:#E0FFFF,stroke:#5F9EA0,stroke-width:2px,rx:8,ry:8
            IPTools["IP Management Tools<br>mint_and_register_ip_with_terms<br>get_license_terms,<br>mint_license_tokens,<br>send_ip,<br>create_spg_nft_collection"]
            style IPTools fill:#E0FFFF,stroke:#5F9EA0,stroke-width:2px,rx:8,ry:8
        end
    end

    subgraph "External Resources"
        style External Resources fill:#FFF0F5,stroke:#FFB6C1,stroke-width:2px,rx:10,ry:10
        IPFS[(IPFS/Pinata<br>Storage)]
        style IPFS fill:#FFE4E1,stroke:#DB7093,stroke-width:2px,rx:15,ry:15
        Blockchain[(Story Protocol<br>Blockchain)]
        style Blockchain fill:#E0F8E0,stroke:#90EE90,stroke-width:2px,rx:15,ry:15
        StoryScan[(StoryScan/Blockscout<br>API)]
        style StoryScan fill:#E6F3FF,stroke:#87CEFA,stroke-width:2px,rx:15,ry:15
    end

    Agent <--MCP Protocol--> StoryService
    Agent <--MCP Protocol--> StoryscanService
    StoryscanService --> StoryscanToolset
    StoryService --> IPFSTools
    StoryService --> IPTools

    StoryscanToolset <--API Calls--> StoryScan
    IPFSTools <--API Calls--> IPFS
    IPTools <--RPC Calls--> Blockchain

Related MCP server: Storybook MCP Server

MCP 服务器

StoryScan MCP 服务器

提供查询区块链数据的工具,包括地址余额、交易和区块链统计数据。

工具:

  • check_balance :检查地址的余额

  • get_transactions :获取地址的最近交易

  • get_stats :获取当前区块链统计数据

  • get_address_overview :获取地址的全面概述

  • get_token_holdings :获取某个地址的所有 ERC-20 代币持有量

  • get_nft_holdings :获取某个地址的所有 NFT 持有量

  • interpret_transaction :获取交易的人类可读解释

Story SDK MCP 服务器

提供与 Story Protocol 的 Python SDK 交互的工具。

工具:

  • get_license_terms :检索特定 ID 的许可条款

  • mint_license_tokens :针对特定 IP 和许可条款的 Mint 许可证令牌

  • send_ip :使用本机令牌传输将 IP 令牌发送到指定地址

  • upload_image_to_ipfs :将图像上传到 IPFS 并返回 URI

  • create_ip_metadata :为特定图像 URI 创建 NFT 元数据

  • mint_and_register_ip_with_terms :创建并注册一个带有条款的 IP

设置

先决条件

  • Python 3.12+

  • UV包管理器

安装

  1. 安装 UV 包管理器并安装环境:

curl -LsSf https://astral.sh/uv/install.sh | sh
  1. 克隆此存储库:

git clone https://github.com/piplabs/story-mcp-hub.git
cd story-mcp-hub
  1. 使用 UV 安装依赖项:

uv sync
  1. 为每个服务器设置环境变量:

对于 StoryScan MCP:

cd storyscan-mcp
cp .env.example .env
# Edit .env with your StoryScan API endpoint

对于 Story SDK MCP:

cd story-sdk-mcp
cp .env.example .env
# Edit .env with your wallet private key, RPC provider URL, etc.

运行服务器

StoryScan MCP 服务器检查器

cd storyscan-mcp
uv run mcp dev server.py

Story SDK MCP 服务器

cd story-sdk-mcp
uv run mcp dev server.py

与 MCP 客户端一起使用

按照以下说明将 MCP 服务器连接到各种与 MCP 兼容的客户端。

光标

Cursor 实现了一个 MCP 客户端,该客户端支持任意数量的具有stdiosse传输的 MCP 服务器。

在 Cursor 中添加 MCP 服务器

  1. 前往Cursor Settings > Features > MCP

  2. 点击+ Add New MCP Server按钮

  3. 填写表格:

    • Type下选择传输

    • Name字段中输入服务器的昵称

    • 根据传输方式输入要运行的命令或服务器的 URL

    • 我们将使用uv命令来运行服务器,因此请确保在服务器路径中包含--directory标志(例如: uv --directory ~/path/to/story-mcp-hub/storyscan-mcp run server.py

截图于 2025-03-10 下午 2 点 50 分 48 秒

项目特定的 MCP 配置

您可以使用.cursor/mcp.json配置特定于项目的 MCP 服务器。该文件遵循以下格式:

{
  "mcpServers": {
    "storyscan-mcp": {
      "command": "uv",
      "args": [
        "--directory",
        "~/path/to/story-mcp-hub/storyscan-mcp",
        "run",
        "server.py"
      ]
    },
    "story-sdk-mcp": {
      "command": "uv",
      "args": [
        "--directory",
        "~/path/to/story-mcp-hub/story-sdk-mcp",
        "run",
        "server.py"
      ]
    }
  }
}

在 Cursor 中使用 MCP 工具

如果 Composer Agent 认为相关,它将自动使用 MCP 设置页面Available Tools下列出的所有 MCP 工具。为了提示用户使用工具,只需告知代理使用该工具,并引用其名称或描述即可。

当代理想要使用 MCP 工具时,它会显示一条消息请求您的批准。

克劳德桌面

可以通过编辑配置文件将 Claude Desktop 配置为使用 MCP 服务器。

在 Claude Desktop 中添加 MCP 服务器

  1. 打开Claude桌面配置文件:

code ~/Library/Application\ Support/Claude/claude_desktop_config.json
  1. 添加 MCP 服务器配置:

{
  "mcpServers": {
    "storyscan-mcp": {
      "command": "uv",
      "args": [
        "--directory",
        "~/path/to/story-mcp-hub/storyscan-mcp",
        "run",
        "server.py"
      ],
      // Add environment variables for the server
      "env": {
        "STORY_API_KEY": "your_story_api_key_here",
        "STORYSCAN_API_ENDPOINT": "your_story_api_endpoint_here"
      }
    },
    "story-sdk-mcp": {
      "command": "uv",
      "args": [
        "--directory",
        "~/path/to/story-mcp-hub/story-sdk-mcp",
        "run",
        "server.py"
      ],
      // Add environment variables for the server
      "env": {
        "WALLET_PRIVATE_KEY": "your_private_key_here",
        "RPC_PROVIDER_URL": "your_rpc_provider_url_here",
        "PINATA_JWT": "your_pinata_jwt_here"
      }
    }
  }
}
  1. 保存文件并重新启动 Claude Desktop 以使更改生效。

截图于 2025-03-10 下午 2:57 24:00

示例查询: use storyscan to check balance of 0x95A13F457C76d10A40D7e8497eD4F40c53F4d04b

发展

要将新的 MCP 服务器添加到集线器:

  1. 为您的服务器创建新目录

  2. 在您的服务器中实现 MCP 协议

  3. 将任何必要的依赖项添加到根pyproject.toml

  4. 使用有关您的服务器的信息更新此自述文件

故障排除

如果您遇到问题:

  1. 验证每个服务器的环境变量是否设置正确

  2. 检查与外部 API(StoryScan、IPFS 等)的网络连接

  3. 确保您使用的是正确的 Python 版本(3.12+)

  4. 使用uv sync检查所有依赖项是否已安装

执照

MIT 许可证

-
security - not tested
A
license - permissive license
-
quality - not tested

Resources

Looking for Admin?

Admins can modify the Dockerfile, update the server description, and track usage metrics. If you are the server author, to access the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/piplabs/story-mcp-hub'

If you have feedback or need assistance with the MCP directory API, please join our Discord server