股票数据查询服务

一个基于Model Context Protocol (MCP)的服务器,用于查询股票市场数据并与Investidor10 API集成。

  • by newerton
  • TypeScript
  • 本地部署
  • 5 星标
  • 更新于
在 GitHub 查看 newerton/mcp-investidor10

使用说明

Investidor10-MCP服务器

该项目是模型上下文协议(MCP)生态系统的一部分,提供了与外部API交互和管理特定域模型的工具。它旨在演示如何构建具有外部API集成和数据验证的MCP服务器。

An integration that enables MCP tools to query stock market data, such as stock prices, and indicators, using the Investidor10 API.

目录

特性

  • 获取acoes:获取基本库存信息。
  • 使用以下方式进行输入验证 萨德.
  • 使用与Investidor10 API集成 fetch (基础设施层)。

建筑

该项目遵循分层架构,灵感来自 领域驱动设计 (DDD)模式:

  • 领域 (src/domain): 定义表示数据结构的接口和类型(例如。, Investidor10).

  • 基础设施 (src/infrastructure): 实现外部服务,例如 Investidor10ApiService,负责对Investidor10 API进行HTTP调用。

  • 应用 (src/application): 包含业务逻辑 Investidor10Service,它处理和格式化来自基础设施的数据。

  • 接口 (src/interface): 包括控制器(Investidor10ToolsController)在MCP服务器中注册工具,定义验证模式,并返回结果。

  • 入口点 (src/main.ts): 初始化 McpServer,配置传输(StdioServerTransport),实例化服务和控制器,并开始监听 标准输入输出.

文件夹结构如下:

src/
├── domain/
│   └── models/           # Domain interfaces
├── infrastructure/
│   └── services/         # External API implementations (Investidor10)
├── application/
│   └── services/         # Business logic and data formatting
├── interface/
│   └── controllers/      # MCP tool registration and validation
└── main.ts               # Server entry point
build/                    # Compiled JavaScript code
.vscode/                  # Contains the mcp.json file, MCP Server config

安装

git clone git@github.com:newerton/mcp-investidor10.git
cd mcp-investidor10
npm install
npm run build

VSCode中的MCP服务器配置

  1. 按 Ctrl+Shift+P 并选择“MCP:列出服务器”
  2. 选择“股票”,然后选择“启动服务器”

VSCode中的MCP服务器输出

  1. 按 Ctrl+Shift+P 并选择“MCP:列出服务器”
  2. 选择“库存”,然后选择“显示输出”

贡献

欢迎拉取请求!欢迎提出问题并讨论改进。

许可证

此项目根据MIT许可证获得许可-请参阅 许可证 文件以获取详细信息。