Content
# TossInvest MCP
[](https://lobehub.com/mcp/scjang01-tossinvest-mcp)
## Program Overview
`tossinvest-mcp` is a local MCP server that allows you to use Toss Securities Open API (current price inquiry, order, balance inquiry, etc.) in MCP-supported apps like OpenAI service, Claude Desktop, and Cursor.
In simple terms, if you register this program with your MCP client, you can ask AI to perform tasks like:
```text
Check the current price of Samsung Electronics.
```
```text
Show me my Toss Securities holdings.
```
```text
Show me the list of pending orders.
```
This program runs only on your computer.
## Important Notes
Toss Securities Open API does not have a sandbox or mock investment environment.
If you enable trading features, you can create, modify, and cancel actual orders in your account. Be cautious and do not enable trading features without verifying the inquiry functions first.
By default, order creation, modification, and cancellation tools are not registered.
## Program Features and Characteristics
You can use the following features without enabling trading:
- Domestic/US stock current price inquiry
- Quote inquiry
- Recent trade history inquiry
- Candlestick chart inquiry
- Upper/lower price limit inquiry
- Stock basic information inquiry
- Investment caution inquiry
- Exchange rate inquiry
- Domestic/US market operation time inquiry
- Account list inquiry
- Holdings inquiry
- Available purchase amount inquiry
- Available sale quantity inquiry
- Trading fee inquiry
- Order list inquiry
- Order detail inquiry
Tools available when trading is enabled:
- `toss_create_order`: Order creation
- `toss_modify_order`: Order modification
- `toss_cancel_order`: Order cancellation
Characteristics:
- Executed with `npx tossinvest-mcp` for a short installation process
- API Key and Secret Key are passed as environment variables
- OAuth token is automatically issued and updated 60 seconds before expiration
- Account required functions use `accountSeq` 1 by default
- Change `TOSSINVEST_ACCOUNT` value to use a different account
- Order creation, modification, and cancellation tools are disabled by default
- `confirmOrderAction: true` is required for order API calls
- Advanced option `TOSSINVEST_YOLO_TRADING=true` allows order API calls without confirmation
## Installation
Follow these steps:
### 1. Node.js Installation Check
Open a terminal or PowerShell and run:
```bash
node -v
```
If `v20` or higher is displayed, proceed to the next step.
If Node.js is not installed or the version is low, install the LTS version from https://nodejs.org and reopen the terminal.
### 2. Toss Securities Open API Key Preparation
Log in to Toss Securities WTS and navigate to the Open API settings screen.
Obtain the following values:
- `API Key`
- `Secret Key`
Do not share these values with others.
### 3. Allowed IP Registration
Toss Securities Open API only allows calls from registered IPs.
Check your public IP:
PowerShell (Windows):
```powershell
(Invoke-WebRequest -UseBasicParsing https://api.ipify.org).Content
```
macOS or Linux terminal:
```bash
curl https://api.ipify.org
```
Add the public IP to the allowed IP list in Toss Securities WTS Open API settings.
### 4. MCP Client Registration
Add the following content to your MCP client settings file or MCP Servers settings screen:
```json
{
"mcpServers": {
"tossinvest": {
"command": "npx",
"args": ["tossinvest-mcp"],
"env": {
"TOSSINVEST_API_KEY": "issued-API-Key",
"TOSSINVEST_SECRET_KEY": "issued-Secret-Key"
}
}
}
}
```
Restart the MCP client after configuration.
### 5. Account Number Verification
Initially, you do not need to specify `TOSSINVEST_ACCOUNT`.
This program uses `accountSeq` 1 by default.
If you have multiple accounts or want to verify the account, inquire about the account list:
```text
Check my Toss Securities account list.
```
Find the `accountSeq` value in the response.
To use a different account, add or change the `TOSSINVEST_ACCOUNT` value:
```json
"TOSSINVEST_ACCOUNT": "1"
```
Example:
```json
{
"mcpServers": {
"tossinvest": {
"command": "npx",
"args": ["tossinvest-mcp"],
"env": {
"TOSSINVEST_API_KEY": "issued-API-Key",
"TOSSINVEST_SECRET_KEY": "issued-Secret-Key",
"TOSSINVEST_ACCOUNT": "1"
}
}
}
}
```
### 6. Inquiry Function Testing
Test with your MCP client:
```text
Check the current price of Samsung Electronics.
```
```text
Show me my Toss Securities holdings.
```
```text
Check the recent trade history of AAPL.
```
```text
Show me the list of pending orders.
```
## Enabling Trading
Caution: Toss Securities Open API does not have a sandbox.
Trading features can send actual orders.
To use trading features, add the following value to your MCP client settings:
```json
"TOSSINVEST_ENABLE_TRADING": "true"
```
Example:
```json
{
"mcpServers": {
"tossinvest": {
"command": "npx",
"args": ["tossinvest-mcp"],
"env": {
"TOSSINVEST_API_KEY": "issued-API-Key",
"TOSSINVEST_SECRET_KEY": "issued-Secret-Key",
"TOSSINVEST_ACCOUNT": "1",
"TOSSINVEST_ENABLE_TRADING": "true"
}
}
}
}
```
Order tools require `confirmOrderAction: true` for actual order execution.
### `confirmOrderAction` Verification
`confirmOrderAction` is not an environment variable.
When calling order tools, include `confirmOrderAction: true` in the request.
Example:
```json
{
"confirmOrderAction": true,
"symbol": "005930",
"side": "BUY",
"orderType": "LIMIT",
"quantity": "1",
"price": "70000"
}
```
When requesting with your MCP client:
```text
Buy 1 share of Samsung Electronics at 70000 KRW.
Confirm the actual order execution with confirmOrderAction set to true.
```
### Order Execution without Verification
Not recommended.
For automation environments, you can add:
```json
"TOSSINVEST_YOLO_TRADING": "true"
```
This option increases the risk of accidental orders.
## Environment Variable Explanation
| Name | Required | Description |
| --- | --- | --- |
| `TOSSINVEST_API_KEY` | Yes | Toss Securities Open API Key |
| `TOSSINVEST_SECRET_KEY` | Yes | Toss Securities Open API Secret Key |
| `TOSSINVEST_ACCOUNT` | No | Default `accountSeq` for Toss Securities. Defaults to `1` if not set |
| `TOSSINVEST_BASE_URL` | No | Defaults to `https://openapi.tossinvest.com` |
| `TOSSINVEST_ENABLE_TRADING` | No | Set to `true` to enable order tools |
| `TOSSINVEST_YOLO_TRADING` | No | Set to `true` to allow order API calls without verification. Not recommended |
## Troubleshooting
### `node` command not found
Node.js is not installed or not in the PATH.
Install the LTS version from https://nodejs.org and reopen the terminal.
### `허용되지 않은 IP 주소입니다.` error
Your public IP is not registered in the Toss Securities Open API allowed IP list.
Register your public IP in the Toss Securities WTS Open API settings.
### MCP client tools not visible
Check the JSON syntax and restart the MCP client.
### Account inquiry fails but holdings inquiry fails
Holdings, orders, and available purchase amount require `accountSeq`.
Use `TOSSINVEST_ACCOUNT` to specify the account.
### Order tools not visible
Normal. Order tools are not registered by default.
Enable trading features with `TOSSINVEST_ENABLE_TRADING=true`.
### Order execution fails with `TOSSINVEST_ENABLE_TRADING=true`
Order tools require `confirmOrderAction: true`.
Specify `confirmOrderAction: true` when requesting orders.
## Developer Notes
To develop this project:
```bash
npm install
npm run typecheck
npm test
npm run build
```
To test order tool flow with mock server:
```bash
npm run smoke:trading:mock
```
## Disclaimer
This program connects Toss Securities Open API to MCP.
It does not provide investment advice, investment recommendations, or profit guarantees.
Information retrieved, AI-generated answers, and AI-suggested orders may be inaccurate, delayed, or different from user intent.
Users are responsible for all investment decisions, order execution, and program usage.
Trading features can send actual orders.
Verify account, price, quantity, order type, and account before ordering.
The developer and distributor of this project are not responsible for investment losses, order errors, API failures, data errors, client malfunctions, or AI response errors.
## License
MIT License
Toss Securities Open API official documentation: https://developers.tossinvest.com/docs