tossinvest-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@tossinvest-mcpshow me my current portfolio holdings"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
tossinvest-mcp-server
An MCP server for the Toss Securities (토스증권) Open API — Korean (KRX) and US market data, portfolio holdings, order management and price-triggered conditional orders.
28 tools cover every documented endpoint of the Open API (v1.2.5).
Requirements
Node.js 18+
Toss Securities Open API credentials: log into the Toss Securities WTS, go to 설정 › Open API, issue a
client_id/client_secret, and register the calling IP under 허용 IP 관리. Calls from an unregistered IP are rejected with403 edge-blocked.
Related MCP server: tossinvest-openapi-mcp
Install
npm install && npm run buildConfiguration
Variable | Required | Purpose |
| yes¹ | OAuth 2.0 client id |
| yes¹ | OAuth 2.0 client secret |
| no | Pre-issued access token; bypasses the client-credentials flow |
| no | Default |
| no |
|
| no |
|
| no | HTTP port when |
¹ Required unless TOSSINVEST_ACCESS_TOKEN is set.
Tokens are issued, cached and refreshed automatically. Toss keeps exactly one valid token per client, so the server collapses concurrent refreshes into a single request and retries once on a rejected token.
Claude Desktop / Claude Code
{
"mcpServers": {
"tossinvest": {
"command": "node",
"args": ["/absolute/path/to/tossinvest-mcp/dist/index.js"],
"env": {
"TOSSINVEST_CLIENT_ID": "c_...",
"TOSSINVEST_CLIENT_SECRET": "...",
"TOSSINVEST_READ_ONLY": "true"
}
}
}
}Remote / self-hosted (streamable HTTP)
Serves stateless JSON-RPC at POST /mcp, plus an unauthenticated GET /health for container probes.
Bearer authentication is mandatory in this mode — the process refuses to start without MCP_AUTH_TOKEN, because the endpoint exposes credentials that can read your account and place orders. Set MCP_ALLOW_ANONYMOUS=true to override, only when the port is genuinely unreachable from outside a trusted network.
MCP_AUTH_TOKEN=$(openssl rand -hex 32) TRANSPORT=http npm startVariable | Purpose |
| Bearer token clients must present. Minimum 16 chars; compared in constant time |
|
|
| Bind address, default |
| Port the process listens on, default |
| Compose only: host port published on the NAS, default |
Docker / NAS
cp .env.example .env # fill in credentials + MCP_AUTH_TOKEN, then:
docker compose up -d --buildCI publishes a multi-arch image (linux/amd64 + linux/arm64) to GHCR on every push to main. To use it instead of building on the NAS, drop the build: line from docker-compose.yml and set:
image: ghcr.io/meteoroh/tossinvest-mcp:latestThe bundled docker-compose.yml defaults to the conservative setup: read-only mode on, port published to 127.0.0.1 only, container runs unprivileged with a read-only root filesystem and all capabilities dropped. Reach it over a VPN (Tailscale/WireGuard), a Cloudflare Tunnel, or a TLS-terminating reverse proxy rather than publishing it to the internet.
Note that the Toss API allow-lists by IP, so the NAS's public IP must be registered under 허용 IP 관리 — a different IP than your laptop's. Fronting the server with a tunnel or proxy does not change this: outbound calls to Toss still leave from the NAS.
Nginx Proxy Manager
For Portainer stacks or Synology Container Manager — which accept only one file — use the flattened, self-contained examples/docker-compose.npm.yml. It pulls the published image, so the NAS never compiles anything.
Otherwise, docker-compose.npm.yml overlays the networking needed to sit behind an existing NPM instance.
docker compose -f docker-compose.yml -f docker-compose.npm.yml up -d --buildThe base file publishes on loopback, which NPM cannot reach — inside NPM's container, 127.0.0.1 is NPM itself. The overlay drops the host port entirely and joins NPM's network instead, so NPM reaches the server by container name on its internal port 3000 (host port collisions are irrelevant here, since nothing is published). Find that network with:
docker inspect <npm-container> -f '{{range $k,$v := .NetworkSettings.Networks}}{{$k}}{{"\n"}}{{end}}'and set it in .env as NPM_NETWORK (commonly npm_default).
Then in Proxy Hosts › Add Proxy Host:
Field | Value |
Domain Names |
|
Scheme |
|
Forward Hostname |
|
Forward Port |
|
Block Common Exploits | on |
SSL | Let's Encrypt cert, Force SSL on |
Two things to get right:
Do not attach an Access List. NPM's Access Lists use HTTP Basic Auth, which occupies the same
Authorizationheader this server reads its bearer token from. NPM overwrites the header and every request fails with 401. UseMCP_AUTH_TOKENas the gate instead — or, if you want a second layer, add it as a custom header check in the Advanced tab rather than an Access List.Cloudflare SSL/TLS mode must be Full (strict) if the DNS record is proxied (orange cloud).
Flexiblewould leave the Cloudflare→NAS hop unencrypted, which is where your bearer token travels. For the Let's Encrypt cert, use NPM's DNS challenge with a Cloudflare API token — HTTP-01 validation is unreliable through the Cloudflare proxy.
Unlike a tunnel, this needs ports 80 and 443 forwarded to the NAS.
Cloudflare Tunnel (alternative)
docker-compose.cloudflared.yml overlays a cloudflared sidecar, giving you a hostname on your own domain with no inbound port, no port forwarding and no certificate to manage. It also works behind CGNAT.
Zero Trust dashboard → Networks › Tunnels › Create a tunnel (Cloudflared). Copy the token into
.envasTUNNEL_TOKEN.Add a Public Hostname on the tunnel: subdomain
mcp, your domain, serviceHTTP→tossinvest-mcp:3000.Start both containers:
docker compose -f docker-compose.yml -f docker-compose.cloudflared.yml up -d --buildThe overlay clears the host port mapping — cloudflared reaches the server over the internal compose network, so nothing is exposed on the NAS at all.
Add Cloudflare Access in front. Zero Trust → Access › Applications › Self-hosted, covering mcp.yourdomain.com, with a service token policy. Requests without a valid service token are rejected at Cloudflare's edge and never reach your NAS. Clients then send three headers:
{
"mcpServers": {
"tossinvest": {
"url": "https://mcp.yourdomain.com/mcp",
"headers": {
"CF-Access-Client-Id": "....access",
"CF-Access-Client-Secret": "...",
"Authorization": "Bearer YOUR_MCP_AUTH_TOKEN"
}
}
}
}MCP_AUTH_TOKEN stays in place as the origin-level gate, so a Cloudflare misconfiguration alone does not expose the server.
If you enable Access, exclude /health from the policy (or drop your container health check) — otherwise the probe gets a login redirect instead of a 200.
Connecting a client
claude mcp add --transport http tossinvest https://your-host/mcp --header "Authorization: Bearer $MCP_AUTH_TOKEN"Cursor and other mcp.json-based clients take the equivalent:
{
"mcpServers": {
"tossinvest": {
"url": "https://your-host/mcp",
"headers": { "Authorization": "Bearer YOUR_TOKEN" }
}
}
}For clients that only speak stdio, bridge with npx mcp-remote https://your-host/mcp --header "Authorization: Bearer YOUR_TOKEN".
Tools
Market data — no account required
Tool | Purpose |
| Last traded price, up to 200 symbols per call |
| Bid/ask ladder for one symbol |
| Today's most recent executions |
| Daily upper/lower price band |
| OHLCV history, 1-minute or daily, max 200 bars |
| Symbol master data: names, market, type, status, shares outstanding |
| Active trading warnings and VI flags |
| KRW ↔ USD rate |
| KR or US session hours for 3 business days |
| Top-100 by traded value, volume or price change |
| KOSPI/KOSDAQ levels, Korean treasury yields |
| Index / bond-yield OHLCV history |
| KRX buy/sell value by investor type |
Account and portfolio
Tool | Purpose |
| Accounts and their |
| Positions with valuation and P/L |
| Cash available to buy with |
| Shares available to sell |
| Per-market commission rates |
Orders
Tool | Purpose | Mutating |
| Working or finished orders | |
| One order with its fill detail | |
| Place a buy or sell order | ✅ |
| Change price / quantity | ✅ |
| Cancel a working order | ✅ |
Conditional orders
Tool | Purpose | Mutating |
| Active or finished conditional orders | |
| One conditional order in detail | |
| Register a SINGLE / OCO / OTO trigger | ✅ |
| Replace a conditional order | ✅ |
| Stop watching | ✅ |
Safety
The five mutating tools place, change and cancel real orders with real money.
Set
TOSSINVEST_READ_ONLY=trueto drop them entirely — the server then exposes 22 read-only tools and cannot trade at all. This is the recommended default for research and analysis.They are annotated
readOnlyHint: false, destructiveHint: true, so MCP clients that gate destructive tools will prompt before running them.tossinvest_create_orderandtossinvest_create_conditional_orderacceptclient_order_idas an idempotency key. Pass one: a retried request then returns the original order instead of filling twice.A successful create means the order was accepted, not filled. Read the outcome with
tossinvest_get_order.
Conventions
Symbols — KRX uses 6 digits (
005930), US uses tickers (AAPL). There is no name-to-symbol search endpoint.Numbers — prices, quantities and amounts are decimal strings, so precision survives round-tripping. Don't reformat them before sending them back.
Currencies — KRW and USD amounts are always reported separately and never summed. Convert with
tossinvest_get_exchange_ratewhen one figure is wanted.Time — all timestamps are KST (+09:00), including US session times.
Output — every tool takes
response_format:markdown(default, compact) orjson(complete payload). Structured content is returned either way. Oversized list responses are shortened with an explicittruncation_message.
Rate limits
Limits are per client × API group and low — the account group allows 1 request per second. The client retries 429 and 5xx automatically, honouring Retry-After with exponential backoff and jitter (3 attempts). Batch symbols instead of looping; one call with 200 symbols beats 200 calls.
Errors
Failures come back as readable text with a recovery step rather than a stack trace:
Error 422 (insufficient-buying-power): 주문 가능 금액이 부족합니다.
Next step: Not enough cash. Check tossinvest_get_buying_power for the available amount.
Request id: 01HXYZABCDEFG123456789 (include this when contacting Toss support)Development
npm run dev # watch mode
npm run typecheck # strict type check
npm test # build + output schema validation + stdio protocol smoke testnpm test makes one deliberately unauthenticated API call to confirm the error path renders correctly; it never places orders.
License
MIT. Not affiliated with or endorsed by Toss Securities. Using the trading tools is at your own risk.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityBmaintenanceMCP server wrapping Toss Securities Open API, enabling stock price queries and trading for Korean and US stocks via natural language.Last updated31MIT
- AlicenseCqualityCmaintenanceSafe-by-default MCP server for the official Toss Securities Open API, providing read-only market and account data with optional order operations protected by multiple safety gates.Last updated2792MIT
- AlicenseAqualityAmaintenanceToss Securities (토스증권) Open API MCP server for the Korean stock market. Supports real-time quotes, orderbook, candles, account holdings, buying power, and order management (create/modify/cancel) with a built-in safety gate requiring explicit confirmation before any real order is placed.Last updated17311MIT
- Flicense-qualityCmaintenanceEnables MCP clients to read Toss Securities market data and account info, and optionally place real-money orders.Last updated
Related MCP Connectors
MCP server exposing the Backtest360 engine API as tools for AI agents.
Hosted MCP for stocks, options, Greeks, brokers, order previews, alerts, and workflows.
Open-source MCP server for Zerodha Kite Connect. Portfolio, market data, backtesting, alerts.
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/meteoroh/tossinvest-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server