内容
# @outblock/flow-mcp
用于模型上下文协议(Model Context Protocol,MCP)的Flow区块链工具。此包提供了一组工具,用于通过模型上下文协议与Flow区块链进行交互。
<a href="https://glama.ai/mcp/servers/@Outblock/flow-mcp">
<img width="380" height="200" src="https://glama.ai/mcp/servers/@Outblock/flow-mcp/badge" alt="Flow MCP server" />
</a>
## 特性
- 获取任何地址的FLOW余额
- 获取任何Flow代币的余额
- 获取COA账户信息
- 获取合约源代码
- 获取详细的账户信息,包括存储统计
## 安装
```bash
# 使用npm
npm install @outblock/flow-mcp
# 使用bun
bun add @outblock/flow-mcp
```
## MCP配置
要将此工具与Claude一起使用,请将以下内容添加到您的MCP配置中:
```json
{
"mcpServers": {
"flow": {
"command": "npx",
"args": ["-y", "@outblock/flow-mcp"]
}
}
}
```
您可以在以下位置找到您的MCP配置:
- macOS: `~/Library/Application Support/Claude/mcp.json`
- Windows: `%APPDATA%/Claude/mcp.json`
- Linux: `~/.config/Claude/mcp.json`
添加配置后,重启Claude以加载新的MCP服务器。
## 工具
### Flow余额
获取任何地址的FLOW余额:
```ts
{
name: 'get_flow_balance',
input: {
address: string,
network?: 'mainnet' | 'testnet'
}
}
```
### 账户信息
获取详细的账户信息:
```ts
{
name: 'get_account_info',
input: {
address: string,
network?: 'mainnet' | 'testnet'
}
}
```
### 代币余额
获取任何Flow代币的余额:
```ts
{
name: 'get_token_balance',
input: {
address: string,
network?: 'mainnet' | 'testnet'
}
}
```
### COA账户
获取COA账户信息:
```ts
{
name: 'get_coa_account',
input: {
address: string,
network?: 'mainnet' | 'testnet'
}
}
```
### 获取合约
获取合约源代码:
```ts
{
name: 'get_contract',
input: {
address: string,
contractName: string,
network?: 'mainnet' | 'testnet'
}
}
```
## 📂 项目结构
```text
flow-mcp/
├── src/
│ ├── tools/ # MCP工具实现
│ │ ├── flowBalance/ # Flow余额工具
│ │ ├── accountInfo/ # 账户信息工具
│ │ ├── tokenBalance/ # 代币余额工具
│ │ ├── coaAccount/ # COA账户工具
│ │ └── getContract/ # 合约源工具
│ ├── utils/ # 共享工具
│ ├── prompts/ # MCP提示
│ ├── types/ # 类型定义
│ └── bin/ # CLI实现
├── biome.json # Lint配置
├── tsconfig.json # TypeScript配置
└── package.json # 项目依赖
```
## 🛠️ 开发
该项目使用FastMCP进行开发和测试。FastMCP为MCP服务器提供了简化的开发体验。
```bash
# 安装依赖
bun install
# 格式化代码
bun run format
# 运行测试
bun test
# 运行开发服务器
bun run dev
# 检查服务器
bun run inspect
# 构建
bun run build
```
要将您的开发MCP服务器添加到Claude Desktop:
1. 构建项目:
```bash
bun run build
```
2. 添加到您的Claude Desktop配置:
```json
// 只有在需要向您的服务器传递参数时,才需要该参数
{
"mcpServers": {
"your-server-name": {
"command": "node",
"args": ["/path/to/your/project/dist/main.js", "some_argument"]
}
}
}
```
### 创建新工具
该项目包括一个脚本,用于帮助创建新的MCP工具:
```bash
bun run scripts/create-tool.ts <tool-name>
```
这将:
1. 在`src/tools/<tool-name>`下创建一个新的工具目录
2. 生成基本的工具结构,包括:
- index.ts(主要实现)
- schema.ts(工具参数的JSON模式)
- test.ts(测试文件)
3. 更新工具索引文件以导出新工具
示例:
```bash
bun run scripts/create-tool.ts weather
```
### 提交信息格式
- `feat`: 新特性(增加次版本号)
- `fix`: 修复bug(增加补丁版本号)
- `BREAKING CHANGE`: 重大变更(增加主版本号)
## 📜 版本管理
该项目使用[standard-version](https://github.com/conventional-changelog/standard-version)进行自动版本管理。运行`bun run release`以创建新版本。
## 📦 发布到npm
1. 确保您已登录npm:
```bash
npm login
```
2. 构建项目:
```bash
bun run build
```
3. 发布包:
```bash
npm publish
```
在发布新版本之前,请记得使用`bun run release`更新版本号。
## 许可证
MIT许可证 - 详情请参见LICENSE。
## 贡献
欢迎贡献!请随时提交Pull Request。
连接信息
猜你喜欢
Vibe-Trading
Vibe-Trading:您的个人交易代理
ai-berkshire
AI 时代的伯克希尔:基于 Claude Code 的价值投资研究框架。巴菲特·芒格·段永平·李录四大师方法论 + 多Agent并行研究。
HexStrike AI
HexStrike AI是一个AI驱动的MCP网络安全自动化平台,拥有150多个工具。
valuecell
Valuecell是一个用于高效数据管理的Python项目。
tradingview-mcp
AI辅助TradingView图表分析 — 将Claude Code连接到您的TradingView Desktop,实现个人工作流自动化
tradingview-mcp
TradingView MCP Server 提供加密货币和股票的实时市场分析。