KLinePic MCP Server
This server enables post-trade review and visualization by turning broker or exchange trade fills into annotated candlestick chart PNGs. It does not provide trading signals, price predictions, investment advice, or order execution.
Check API access and quota (
klinepic_get_capabilities): Inspect your Agent API key's permissions, plan limits, remaining render quota, and supported endpoints — with no quota cost.Preflight / validate a chart request (
klinepic_preflight_review_chart): Submit broker/exchange fills and K-line data for validation (checks CSV format, data sources, scopes, IP restrictions, plan state, and quota limits) before rendering, without consuming any render quota.Render an annotated candlestick chart (
klinepic_create_review_chart): Generate a PNG candlestick chart with real buy/sell markers annotated from your trade fills; the result is returned as native MCP image content. This action consumes one unit of render quota.
Provides sample data templates for Binance trade history, enabling generation of annotated candlestick chart PNGs from Binance fills.
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.
Run it as an Agent Skill, from source, with the one-click MCPB bundle, or in Docker; the repository also includes OpenAPI examples.
KLinePic is for post-trade review and visualization. It does not provide trading signals, price predictions, investment advice, or order execution.
Example output

Sample-data preview. It is not a trading signal, forecast, or investment recommendation.
Related MCP server: TradingView MCP
What is included
Tool | What it does | Quota impact |
| Checks API-key permissions, plan limits, remaining quota, and supported endpoints. | None |
| Validates fills, K-line data, scopes, and estimated cost before rendering. | None |
| Returns an annotated candlestick PNG as native MCP image content. | Uses one chart render |
The repository also includes:
A reusable Agent Skill for Codex, Claude Code, and other compatible agents.
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. |
Agent Skill validation and discovery | PASS — 1 skill | The official skill validator accepted the package, and the current |
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 |
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:mcpbRun the live, no-charge check with your own key:
KLINE_AGENT_API_KEY=kline_agent_xxx npm run test:production-preflightThe 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.
Install the reviewed post-trade workflow as an Agent Skill:
npx skills add sher1096/klinepic-agent-api-examples --skill klinepic-trade-reviewThe skill tells a compatible agent to inspect completed fills, run the free preflight, ask before consuming render quota, and avoid signals, predictions, advice, or order execution.
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#c48f3dc12a21834a2af165c223230f0cf9500fefOr 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 startMCP 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.0Or build it locally:
docker build -t klinepic-mcp .
docker run --rm -i \
-e KLINE_AGENT_API_KEY=kline_agent_xxx \
klinepic-mcpThe 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 |
Complete request for preflight or rendering | |
Generic broker exports | |
Binance trade history | |
US-stock journals | |
Futures reviews | |
MetaTrader 4/5 history |
Run the standalone no-charge example:
KLINE_AGENT_API_KEY=kline_agent_xxx node examples/preflight.mjsTroubleshooting
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
TensorBlock MCP Index profile — maintained by
@sher1096; verification: self-reportedChinese community walkthrough: turn broker fills into an auditable review chart
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.
Available Tools
3 toolsklinepic_create_review_chartCreate an annotated trade-review chartA
Render one PNG candlestick chart with real buy/sell markers. This consumes render quota; preflight first. It does not provide trading signals or investment advice.
| Name | Required | Description | Default |
|---|---|---|---|
| request | Yes | KLinePic Agent API request body. Put chart fields under chart. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Without annotations, the description adds some behavioral context: quota consumption and disclaiming investment advice. But it lacks details on failure modes, timeouts, or output format, leaving gaps.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three succinct sentences: purpose, usage caveat, and disclaimer. No wasted words, effectively front-loaded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (single nested param, no output schema), the description covers core purpose and quota usage but omits details on request structure and expected output, leaving an agent to infer.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with one parameter described. The description adds 'KLinePic Agent API request body. Put chart fields under chart,' which marginally clarifies but doesn't significantly extend schema information.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states 'Render one PNG candlestick chart with real buy/sell markers,' which provides a specific verb and resource. It clearly distinguishes from sibling tools like preflight_review_chart and get_capabilities.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description says 'This consumes render quota; preflight first,' giving explicit usage context and a prerequisite. However, it does not provide explicit when-not-to-use or alternatives to siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
klinepic_get_capabilitiesCheck KLinePic API access and quotaA
Check the current Agent API key, permissions, free or paid quota, and supported endpoints.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description carries full burden. It honestly discloses that the tool queries current key, permissions, quota, and endpoints. This is a read-only check with no destructive potential, though response format is not described.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence, front-loaded with 'Check', zero wasted words. Perfectly concise for a parameterless tool.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Low complexity (0 params, no output schema). Description covers what capabilities are checked. Missing details on response format are acceptable for such a simple tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
No parameters exist; baseline 4 applies. Description doesn't add param info because it's not needed. Schema coverage is 100% implicitly.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states verb 'Check' and resource 'KLinePic API' with specific items: API key, permissions, quota, supported endpoints. Distinguishes from sibling tools which focus on chart creation and preflight checks.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Context implies use before chart creation operations to verify access and quota, but no explicit when-not or alternative guidance. Sibling names suggest workflow context (preflight, create).
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
klinepic_preflight_review_chartPreflight a trade-review chartA
Validate broker or exchange fills plus K-line data without consuming render quota. Call this before rendering.
| Name | Required | Description | Default |
|---|---|---|---|
| request | Yes | KLinePic Agent API request body. Put chart fields under chart. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full burden. It discloses non-destructive behavior (no render quota consumption) but omits details on what validation entails, failure behavior, or auth requirements. Minimal but adequate.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, each earning its place: first sentence states action and benefit, second gives usage instruction. No wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description covers purpose and usage but lacks output behavior (e.g., what validation results look like) and does not elaborate on the nested object parameter's structure beyond what schema provides. Adequate for a preflight tool but missing completeness for a parameter with additionalProperties.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with a generic parameter description. The tool description adds no extra meaning to the 'request' parameter; it only restates the validation action. Baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly identifies the tool as a preflight validation step for broker/exchange fills and K-line data, explicitly stating it does not consume render quota. This distinguishes it from the sibling tool klinepic_create_review_chart which presumably renders.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly instructs 'Call this before rendering', providing clear when-to-use guidance. It does not state when not to use, but the purpose and sibling context imply alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
3 tool updates
v0.1.0- First observed
klinepic_create_review_chart - First observed
klinepic_get_capabilities - First observed
klinepic_preflight_review_chart
TDQS
Each tool has a distinct purpose: preflight validation without quota consumption, actual chart rendering, and capability/status checking. No overlap in functionality.
All tools follow a consistent `klinepic_verb_noun` pattern using snake_case, making them easy to distinguish and predict.
Three tools cover the essential workflow (validate, render, check capabilities) without unnecessary bloat or missing critical actions.
The tool surface covers the full lifecycle of chart creation: preflight validation, rendering, and quota/status inquiry. No obvious gaps for the stated purpose.
Maintenance
Related MCP Connectors
Trading journal with pattern detection: log trades by voice, query your own history.
Query your trades, stats, and journal in EdgeLock and log new entries by chat. OAuth; free account.
Live LinReg fan charts, 64-setup playbook, 11-section MTF TA. Remote MCP, no API key.
Real-time & historical Hyperliquid/Lighter: L4/L2/L3, fills, funding, OI, liquidations, candles
Related MCP Servers
- FlicenseCqualityDmaintenanceEnables cryptocurrency trading on Bybit exchange through comprehensive market data access, account management, and automated trading operations. Features smart position validation, trailing stop losses, and risk management tools with demo mode support for safe testing.21-
- FlicenseNot gradedqualityCmaintenanceEnables automated control of TradingView Desktop via Chrome DevTools Protocol with 78+ tools for chart manipulation, Pine Script development, and indicator analysis. Supports automated morning briefs for session bias generation, replay trading practice, and multi-pane layouts with secure local-only data processing.2-
- FlicenseNot gradedqualityDmaintenanceEnables automated trading analysis and chart management through the TradingView Desktop app. Provides tools for morning brief workflows, Pine Script development, chart navigation, and replay mode practice with local data processing.552-
- FlicenseNot gradedqualityDmaintenanceIntegrates Interactive Brokers and TradeStation APIs for portfolio management, market data, and trading operations, with TradingView market scanning.-
Appeared in Searches
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/sher1096/klinepic-agent-api-examples'
If you have feedback or need assistance with the MCP directory API, please join our Discord server