Warpcast MCP 服务器
用于 Warpcast 集成的模型上下文协议 (MCP) 服务器,允许您使用 Claude 与您的 Warpcast 帐户进行交互。
特征
将演出发布到您的 Warpcast 帐户
阅读 Warpcast 中的广播
通过关键字或标签搜索演员
浏览频道并与之互动
关注/取消关注频道
获取热门演员
Related MCP server: MCP Fetch
设置
克隆此存储库
git clone https://github.com/zhangzhongnan928/mcp-warpcast-server.git cd mcp-warpcast-server安装依赖项
npm install生成 API 密钥并配置身份验证
此 MCP 服务器提供了一个辅助脚本来生成必要的 Ed25519 密钥对:
npm run generate-keys按照提示操作:
生成随机 Ed25519 密钥对
将密钥保存到
.env文件中获取使用 Warpcast 注册密钥的说明
或者,如果您喜欢手动设置:
选项 1:使用签名密钥请求
生成 Ed25519 密钥对
使用 Warpcast 签名密钥请求 API 请求代表您的帐户签署消息的权限
在 Warpcast 应用程序中完成授权
以下是一个示例实现:
import * as ed from '@noble/ed25519';
import { mnemonicToAccount, signTypedData } from 'viem/accounts';
import axios from 'axios';
// Generate a keypair
const privateKey = ed.utils.randomPrivateKey();
const publicKeyBytes = await ed.getPublicKey(privateKey);
const key = '0x' + Buffer.from(publicKeyBytes).toString('hex');
// EIP-712 domain and types for SignedKeyRequest
const SIGNED_KEY_REQUEST_VALIDATOR_EIP_712_DOMAIN = {
name: 'Farcaster SignedKeyRequestValidator',
version: '1',
chainId: 10,
verifyingContract: '0x00000000fc700472606ed4fa22623acf62c60553',
};
const SIGNED_KEY_REQUEST_TYPE = [
{ name: 'requestFid', type: 'uint256' },
{ name: 'key', type: 'bytes' },
{ name: 'deadline', type: 'uint256' },
];
// Generate a Signed Key Request signature
const appFid = process.env.APP_FID;
const account = mnemonicToAccount(process.env.APP_MNEMONIC);
const deadline = Math.floor(Date.now() / 1000) + 86400; // signature is valid for 1 day
const signature = await account.signTypedData({
domain: SIGNED_KEY_REQUEST_VALIDATOR_EIP_712_DOMAIN,
types: {
SignedKeyRequest: SIGNED_KEY_REQUEST_TYPE,
},
primaryType: 'SignedKeyRequest',
message: {
requestFid: BigInt(appFid),
key,
deadline: BigInt(deadline),
},
});
// Create a Signed Key Request
const warpcastApi = 'https://api.warpcast.com';
const { token, deeplinkUrl } = await axios
.post(`${warpcastApi}/v2/signed-key-requests`, {
key,
requestFid: appFid,
signature,
deadline,
})
.then((response) => response.data.result.signedKeyRequest);
console.log('Deep link URL:', deeplinkUrl);
console.log('Open this URL on your mobile device with Warpcast installed to authorize this key');选项 2:使用现有的 App Key
如果您已经为 Farcaster 帐户设置了 App Key,则可以直接使用 FID、私钥和公钥。
构建服务器
npm run build配置 Claude for Desktop 以使用此服务器
使用 Claude for Desktop 进行配置
将以下内容添加到您的claude_desktop_config.json中:
{
"mcpServers": {
"warpcast": {
"command": "node",
"args": [
"/absolute/path/to/mcp-warpcast-server/build/index.js"
],
"env": {
"WARPCAST_FID": "your_fid_here",
"WARPCAST_PRIVATE_KEY": "your_private_key_here",
"WARPCAST_PUBLIC_KEY": "your_public_key_here"
}
}
}
}将/absolute/path/to/mcp-warpcast-server替换为您克隆此存储库的实际绝对路径,并使用您的实际凭据更新环境变量。
用法
配置完成后,您可以要求 Claude:
“发布关于[主题]的演说”
“阅读[用户名]的最新演说”
“搜索有关[主题]的演员表”
“向我展示 Warpcast 上的热门演员”
“向我展示 Warpcast 上的热门频道”
“从 [channel] 频道获取演员表”
“帮我关注[频道]频道”
可用工具
该 MCP 服务器提供了 Claude 可以使用的几个工具:
post-cast :在 Warpcast 上创建新帖子(最多 320 个字符)
get-user-casts :检索特定用户的最近演员表
search-casts :按关键字或短语搜索演员表
get-trending-casts :获取 Warpcast 上当前流行的演员表
get-all-channels :列出 Warpcast 上可用的频道
get-channel :获取有关特定频道的信息
get-channel-casts :从特定频道获取广播
follow-channel :关注频道
取消关注频道:取消关注频道
认证须知
此服务器使用 Warpcast 的 App Key 身份验证方法,需要使用 Farcaster 帐户注册 Ed25519 密钥对。身份验证流程如下:
创建包含您的 FID 和公钥的标头
创建具有到期时间的有效负载
使用你的私钥对 header 和有效负载进行签名
使用生成的令牌进行 API 调用
在生产应用程序中,建议使用官方 Farcaster SDK 来生成身份验证令牌。
安全注意事项
确保你的私钥安全,切勿与他人分享
考虑定期轮换密钥
服务器记录身份验证错误以帮助调试
故障排除
如果您遇到问题:
检查环境变量是否设置正确
确保您的密钥已正确注册到您的 Farcaster 帐户
检查 Claude for Desktop 日志中是否存在任何错误
验证您的 Warpcast 帐户是否具有必要的权限
执照
麻省理工学院