Ntropy金融数据丰富工具
启用通过Ntropy API丰富银行数据的功能,提供创建账户持有人和高效丰富交易的工具。
服务介绍
Ntropy MCP 服务器
使用 Ntropy API 丰富银行数据的 MCP 服务器。这使得处理财务数据的 LLM 代理可以轻松调用任何 Ntropy API 端点。
组件
工具
服务器实现了以下工具来与 Ntropy API 交互:
-
check_connection: 验证与 Ntropy API 的连接
- 返回:连接状态信息
-
set_api_key: 在运行时设置或更新 Ntropy API 密钥
- 参数:
api_key(字符串) - 返回:API 密钥更新和验证的状态
- 参数:
-
create_account_holder: 创建账户持有人
- 参数:
id(字符串/整数),type(字符串),name(字符串) - 返回:创建的账户持有人详细信息
- 参数:
-
update_account_holder: 更新现有账户持有人
- 参数:
id(字符串/整数),name(字符串, 可选),type(字符串, 可选) - 返回:更新后的账户持有人详细信息
- 参数:
-
enrich_transaction: 丰富银行交易
- 参数:
id(字符串/整数),description(字符串),date(字符串),amount(浮点数),entry_type(字符串),currency(字符串),account_holder_id(字符串/整数),country(字符串, 可选) - 返回:丰富的交易数据
- 参数:
-
get_account_holder: 获取账户持有人的详细信息
- 参数:
account_holder_id(字符串/整数) - 返回:账户持有人详细信息
- 参数:
-
list_transactions: 列出账户持有人的交易
- 参数:
account_holder_id(字符串/整数),limit(整数, 默认=10),offset(整数, 默认=0) - 返回:交易列表
- 参数:
-
get_transaction: 获取特定交易的详细信息
- 参数:
transaction_id(字符串/整数) - 返回:交易详细信息
- 参数:
-
bulk_enrich_transactions: 一次性丰富多个交易
- 参数:
transactions(交易对象列表) - 返回:丰富的交易列表
- 参数:
-
delete_account_holder: 删除账户持有人及其所有相关数据
- 参数:
account_holder_id(字符串/整数) - 返回:删除状态
- 参数:
-
delete_transaction: 删除特定交易
- 参数:
transaction_id(字符串/整数) - 返回:删除状态
- 参数:
快速开始
安装
首先,通过在 ntropy.com 上创建帐户来获取您的 Ntropy API 密钥。确保将下面的 YOUR_NTROPY_API_KEY 替换为您的实际 API 密钥。
使用 uvx 运行服务器
uvx ntropy-mcp --api-key YOUR_NTROPY_API_KEY
Claude 桌面版
Claude 桌面配置文件通常位于:
在 MacOS 上: ~/Library/Application\ Support/Claude/claude_desktop_config.json
在 Windows 上: %APPDATA%/Claude/claude_desktop_config.json
如果使用 uvx,请在配置文件中添加以下内容:
"mcpServers": {
"ntropy-mcp": {
"command": "uvx",
"args": [
"ntropy-mcp",
"--api-key",
"YOUR_NTROPY_API_KEY"
]
}
}
如果使用 docker,请在配置文件中添加以下内容:
"mcpServers": {
"ntropy-mcp": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ntropy-mcp"
"--api-key",
"YOUR_NTROPY_API_KEY"
]
}
}
示例用法
检查连接
# Check if your API key is valid and the Ntropy API is accessible
connection_status = check_connection()
print(connection_status)
创建和更新账户持有人
# Create a new account holder
account_holder = create_account_holder(
id="user123",
type="individual",
name="John Doe"
)
# Update an existing account holder
updated_account = update_account_holder(
id="user123",
name="John Smith"
)
丰富交易
# Enrich a single transaction
enriched_transaction = enrich_transaction(
id="tx123",
description="AMAZON.COM*MK1AB6TE1",
date="2023-05-15",
amount=-29.99,
entry_type="debit",
currency="USD",
account_holder_id="user123",
country="US"
)
# Bulk enrich multiple transactions
transactions = [
{
"id": "tx124",
"description": "NETFLIX.COM",
"date": "2023-05-16",
"amount": -13.99,
"entry_type": "debit",
"currency": "USD",
"account_holder_id": "user123"
},
{
"id": "tx125",
"description": "Starbucks Coffee",
"date": "2023-05-17",
"amount": -5.65,
"entry_type": "debit",
"currency": "USD",
"account_holder_id": "user123"
}
]
enriched_transactions = bulk_enrich_transactions(transactions)
调试
您可以使用 MCP 检查器来调试服务器。对于 uvx 安装:
npx @modelcontextprotocol/inspector uvx ntropy-mcp --api-key YOUR_NTROPY_API_KEY
构建
Docker 构建:
docker build -t ntropy-mcp .
贡献
欢迎提交拉取请求!请随时贡献新想法、错误修复或增强功能。
许可证
ntropy-mcp 采用 MIT 许可证。这意味着您可以在遵守 MIT 许可证的条款和条件的前提下自由使用、修改和分发该软件。更多详情,请参见项目仓库中的 LICENSE 文件。