
连接美国财政部数据的MCP服务器,采用MCP-Framework构建
概览
财政数据MCP服务器演示了一个MCP服务器的实际实现,该服务器连接美国财政部的财政数据API。它展示了: - 获取特定财务报表的工具 - 历史数据访问资源 - 生成格式化报告的提示 将此配置添加到您的Claude桌面配置文件中: : ~/Library/Application Support/Claude/claude_desktop_config.json : %APPDATA%/Claude/claude_desktop_config.json 配置完成后,您可以通过Claude与服务器交互: 使用get_daily_treasury_statement工具获取特定日期的财政部数据: 通过资源系统访问30天的历史宝藏数据: - 自动缓存1小时 - 按需更新 - 提供格式化的JSON数据
概述(AI 翻译)
概述
财政数据MCP服务器演示了一个MCP服务器的实际实现,该服务器连接美国财政部的财政数据API。它展示了:
- 获取特定财务报表的工具
- 历史数据访问资源
- 生成格式化报告的提示
快速启动
1.安装与使用 Claude Desktop
将此配置添加到您的Claude桌面配置文件中:
MacOS:~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
2.示例交互
配置完成后,您可以通过Claude与服务器交互:
特色
1.每日国库报表
使用 get_daily_treasury_statement 工具获取特定日期的财政部数据:
2.历史数据资源
通过资源系统访问30天的历史宝藏数据:
- 自动缓存1小时
- 按需更新
- 提供格式化的JSON数据
3.报表生成
使用daily_treasury_report提示生成格式化的财务报告:
本页由 AI 翻译,技术细节请以原文为准。
README
Overview
The Fiscal Data MCP Server demonstrates a practical implementation of an MCP server that connects to the US Treasury’s Fiscal Data API. It showcases:
- Tools for fetching specific treasury statements
- Resources for historical data access
- Prompts for generating formatted reports
Quick Start
1. Install and Use with Claude Desktop
Add this configuration to your Claude Desktop config file:
MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"fiscal-data": {
"command": "npx",
"args": ["fiscal-data-mcp"]
}
}
}
2. Example Interactions
Once configured, you can interact with the server through Claude:
Human: Can you get the treasury statement for the 20th of September 2023?
Features
1. Daily Treasury Statements
Fetch treasury data for specific dates using the get_daily_treasury_statement tool:
// Example usage through Claude
Human: Get the treasury statement for 2024-03-01
Assistant: I'll fetch that information for you using the treasury statement tool.
2. Historical Data Resource
Access 30 days of historical treasury data through the resource system:
- Automatically cached for 1 hour
- Updates on demand
- Provides formatted JSON data
3. Report Generation
Generate formatted treasury reports using the daily_treasury_report prompt:
// Example usage through Claude
Human: Generate a treasury report for 2024-03-01
Assistant: I'll use the daily treasury report prompt to create a formatted report...
安装
npx fiscal-data-mcp配置
{
"mcpServers": {
"fiscal-data": {
"command": "npx",
"args": ["fiscal-data-mcp"]
}
}
}