KLinePic MCP Server
Generate annotated post-trade candlestick review-chart PNGs from broker or exchange fills. Includes capability checks, no-charge preflight validation, and chart rendering; no signals or order execution.
README
KLinePic MCP Server and Agent API Examples
Turn broker or exchange fills into annotated candlestick review-chart PNGs. AI agents can discover capabilities, validate a request without spending chart quota, and render the finished chart through three MCP tools.
KLinePic is for post-trade review and visualization. It does not provide trading signals, price predictions, investment advice, or order execution.
What is included
| Tool | What it does | Quota impact |
|---|---|---|
klinepic_get_capabilities |
Checks API-key permissions, plan limits, remaining quota, and supported endpoints. | None |
klinepic_preflight_review_chart |
Validates fills, K-line data, scopes, and estimated cost before rendering. | None |
klinepic_create_review_chart |
Returns an annotated candlestick PNG as native MCP image content. | Uses one chart render |
The repository also includes:
- A working JavaScript stdio MCP server.
- A small Agent API client used by the MCP tools.
- Broker, Binance, US-stock, futures, and MetaTrader sample data.
- A complete review-chart request and a no-charge preflight example.
- Docker support, an OpenAPI mirror, and machine-readable discovery files.
Verified functionality
Local installation was last verified on 2026-07-14. Live API capabilities and preflight were last verified on 2026-07-13:
| Check | Result | What was proved |
|---|---|---|
| API adapter tests | PASS — 4/4 | Bearer authentication, forced review-chart mode, PNG-to-base64 conversion, and structured error handling. |
| Real MCP stdio handshake | PASS — 3 tools | A real MCP client completed initialization and discovered all three tool schemas. |
| Fresh Cline-compatible install | PASS — 3 tools | The Windows cmd /c npx configuration launched the GitHub package from an empty temporary directory and completed MCP initialization plus tool discovery. |
| One-click MCPB bundle | PASS — 3 tools | The official MCPB 0.3 validator accepted the manifest; the packed bundle included runtime dependencies and completed a real stdio handshake. |
| Live production capabilities | PASS | The MCP server called the production capability endpoint with a scoped Agent API key. |
| Live production preflight | PASS | The sample request passed production validation without rendering a chart or consuming chart quota. |
| Container build | PASS in CI | GitHub Actions builds the Docker image from a clean checkout. |
Reproduce the local checks:
npm ci
npm test
npm run test:mcpb
Run the live, no-charge check with your own key:
KLINE_AGENT_API_KEY=kline_agent_xxx npm run test:production-preflight
The live check calls capabilities and preflight only. It does not call the paid render tool.
Quick start
Requirements:
- Node.js 20 or newer.
- A KLinePic Agent API key. Create one from the account page; the free tier does not require a sales conversation.
One-click install for MCPB-compatible desktop clients:
Download klinepic-mcp-server-0.1.0.mcpb, open it in the desktop client, and enter the Agent API key when prompted. The key field is marked sensitive. The API origin defaults to https://klinepic.com; change it only to a trusted HTTPS endpoint because the key and full trade payload are sent there.
Run directly from GitHub:
KLINE_AGENT_API_KEY=kline_agent_xxx \
npx -y github:sher1096/klinepic-agent-api-examples#c48f3dc12a21834a2af165c223230f0cf9500fef
Or clone the repository:
git clone https://github.com/sher1096/klinepic-agent-api-examples.git
cd klinepic-agent-api-examples
npm ci
KLINE_AGENT_API_KEY=kline_agent_xxx npm start
MCP client configuration
Most macOS and Linux clients can run the GitHub package directly:
{
"mcpServers": {
"klinepic": {
"command": "npx",
"args": [
"-y",
"github:sher1096/klinepic-agent-api-examples#c48f3dc12a21834a2af165c223230f0cf9500fef"
],
"env": {
"KLINE_AGENT_API_KEY": "kline_agent_xxx"
}
}
}
}
Some Windows clients need cmd.exe to resolve npx.cmd:
{
"mcpServers": {
"klinepic": {
"command": "cmd",
"args": [
"/c",
"npx",
"-y",
"github:sher1096/klinepic-agent-api-examples#c48f3dc12a21834a2af165c223230f0cf9500fef"
],
"env": {
"KLINE_AGENT_API_KEY": "kline_agent_xxx"
}
}
}
}
Keep the key in the client environment or secret store. Do not commit it.
Docker
Run the published image:
docker run --rm -i \
-e KLINE_AGENT_API_KEY=kline_agent_xxx \
ghcr.io/sher1096/klinepic-mcp-server:0.1.0
Or build it locally:
docker build -t klinepic-mcp .
docker run --rm -i \
-e KLINE_AGENT_API_KEY=kline_agent_xxx \
klinepic-mcp
The container can start without a key so a registry can inspect its tool schemas. API calls still require a valid key.
Recommended agent flow
- Call
klinepic_get_capabilities. - Build a request from the user's fills and K-line data.
- Call
klinepic_preflight_review_chart. - Fix any validation or permission error.
- Ask for confirmation before a quota-consuming render.
- Call
klinepic_create_review_chartand return the PNG.
Preflight first: it catches malformed CSV, unsupported sources, missing scopes, IP restrictions, plan state, and quota limits without rendering.
Sample data
| File | Use case |
|---|---|
review-chart-request.json |
Complete request for preflight or rendering |
broker-trades-template.csv |
Generic broker exports |
binance-trade-history-template.csv |
Binance trade history |
us-stock-trading-journal-template.csv |
US-stock journals |
futures-trade-review-template.csv |
Futures reviews |
metatrader-trade-history-template.csv |
MetaTrader 4/5 history |
Run the standalone no-charge example:
KLINE_AGENT_API_KEY=kline_agent_xxx node examples/preflight.mjs
Troubleshooting
KLINE_AGENT_API_KEY is required— create a key and pass it through the MCP client's environment.- HTTP 401 — the key is invalid or revoked.
- HTTP 402 — the account or key quota is exhausted; capabilities shows the relevant limit.
- HTTP 403 — the key lacks the required scope or its IP allowlist blocks the caller.
- HTTP 422 — the request data is invalid; run preflight and inspect the structured details.
- Windows cannot find
npx— use thecmd /c npxconfiguration above.
Documentation and discovery
- Cline installation guide
- Standalone field guide
- Complete AI/GEO context bundle
- Human-readable Agent API guide
- OpenAPI contract
- GitHub Pages OpenAPI mirror
- Copy-paste quickstart
- Accepted one-click MCPB install and checksum Q&A
- Accepted official MCP Registry and OCI Q&A
- Claimed Glama listing and quality score
- MCP Repository directory listing
- Accepted MCP installation Q&A
- Accepted broker-fill workflow Q&A
- 中文 A 股交割单问答
Security and scope
- Report suspected vulnerabilities through the private security-reporting form, not a public issue.
- API keys are sent only to
https://klinepic.comunlessKLINEPIC_BASE_URLis explicitly overridden. - The server does not store keys, trade records, or generated images locally.
- Use a dedicated key with the smallest useful scopes and limits.
- Review data-handling requirements before sending real trading records.
License
The MCP adapter and examples in this repository are available under the MIT License. The hosted KLinePic API is a separate service governed by its published terms and privacy policy.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。