@nukeguys/toss-invest-mcp 0.0.0-stage → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 nukeguys
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,285 @@
1
- # Temporary Holding Version
1
+ # Toss Invest MCP
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ > Unofficial community project. This package is not affiliated with or endorsed by Toss Securities.
4
+
5
+ Local MCP server backed by the Toss Securities Open API SDK in this repository. It uses the
6
+ standard `stdio` transport, so any MCP-compatible host that can start a local process can use it.
7
+ The server is read-only unless trading is explicitly enabled.
8
+
9
+ Run it without cloning this repository:
10
+
11
+ ```sh
12
+ TOSS_CLIENT_ID=... TOSS_CLIENT_SECRET=... npx -y @nukeguys/toss-invest-mcp
13
+ ```
14
+
15
+ ## Tools
16
+
17
+ - `toss_get_prices`: current prices for up to 200 symbols
18
+ - `toss_get_trades`: recent trades for one symbol
19
+ - `toss_get_price_limit`: daily price limits for one symbol
20
+ - `toss_get_orderbook`: bid and ask quotes for one symbol
21
+ - `toss_get_candles`: minute or daily OHLCV candles
22
+ - `toss_get_stocks`: basic information for up to 200 symbols
23
+ - `toss_list_stocks`: full stock universe for one market
24
+ - `toss_get_stock_warnings`: warnings and trading cautions for one symbol
25
+ - `toss_get_stock_investor_trading`: daily investor trading volumes for one Korean stock
26
+ - `toss_get_stock_program_trades`: daily program trading volumes for one Korean stock
27
+ - `toss_get_stock_short_selling`: daily short selling volumes and ratios for one Korean stock
28
+ - `toss_get_stock_credit_trades`: daily margin loan and stock loan balances for one Korean stock
29
+ - `toss_get_stock_securities_lending`: daily securities lending balances for one Korean stock
30
+ - `toss_get_exchange_rate`: KRW/USD reference exchange rate
31
+ - `toss_get_kr_market_calendar`: Korean market schedule
32
+ - `toss_get_us_market_calendar`: US market schedule
33
+ - `toss_get_rankings`: market and Toss Securities stock rankings
34
+ - `toss_get_investor_trading_rankings`: investor net buying and selling rankings
35
+ - `toss_list_sectors`: sector hierarchy
36
+ - `toss_get_sector_rankings`: sector rankings
37
+ - `toss_get_sector`: sector details and performance
38
+ - `toss_get_sector_stocks`: stocks in a sector
39
+ - `toss_get_sector_etfs`: ETFs associated with a sector
40
+ - `toss_get_market_indicator_prices`: market indicator prices
41
+ - `toss_get_market_indicator_candles`: market indicator candles
42
+ - `toss_get_market_indicator_investor_trading`: KOSPI/KOSDAQ investor trading amounts
43
+ - `toss_list_accounts`: supported brokerage accounts and their `accountSeq`
44
+ - `toss_get_holdings`: holdings for an account
45
+ - `toss_get_transactions`: account transaction history
46
+ - `toss_list_orders`: open or closed order history for an account
47
+ - `toss_get_order`: details for one order
48
+ - `toss_list_conditional_orders`: open or closed conditional orders
49
+ - `toss_get_conditional_order`: details for one conditional order
50
+ - `toss_get_buying_power`: cash-based buying power for an account and currency
51
+ - `toss_get_sellable_quantity`: sellable quantity for one holding
52
+ - `toss_get_commissions`: Korean and US trading commissions
53
+
54
+ With trading enabled, the server also exposes:
55
+
56
+ - `toss_create_order`, `toss_modify_order`, `toss_cancel_order`
57
+ - `toss_create_conditional_order`, `toss_modify_conditional_order`,
58
+ `toss_cancel_conditional_order`
59
+
60
+ Account-specific tools require the `accountSeq` returned by `toss_list_accounts`.
61
+
62
+ ## Trading permissions
63
+
64
+ The server starts in read-only mode. Add `--allow-trading` to the server arguments to register
65
+ order creation, modification, and cancellation tools:
66
+
67
+ ```sh
68
+ npx -y @nukeguys/toss-invest-mcp --allow-trading
69
+ ```
70
+
71
+ Orders worth at least KRW 100 million require Toss Securities' `confirmHighValueOrder` field. To
72
+ allow that field, add both permission flags:
73
+
74
+ ```sh
75
+ npx -y @nukeguys/toss-invest-mcp \
76
+ --allow-trading \
77
+ --allow-high-value-orders
78
+ ```
79
+
80
+ Append the same flags to the `args` array in any host configuration below. Trading tools are
81
+ marked as non-read-only and destructive so the host can apply its approval policy. Persistently
82
+ approving those tools allows unattended automated trading; only do this for a trusted setup.
83
+
84
+ ## Codex app, CLI, and IDE extension
85
+
86
+ These Codex clients share `~/.codex/config.toml`:
87
+
88
+ ```toml
89
+ [mcp_servers.toss-invest]
90
+ command = "npx"
91
+ args = ["-y", "@nukeguys/toss-invest-mcp"]
92
+ env = { TOSS_CLIENT_ID = "...", TOSS_CLIENT_SECRET = "..." }
93
+ ```
94
+
95
+ Restart the client and use `/mcp` to verify the connection. See the
96
+ [Codex MCP documentation](https://learn.chatgpt.com/docs/extend/mcp.md).
97
+
98
+ ## Claude Desktop
99
+
100
+ Open **Settings → Developer → Edit Config**, or edit the platform configuration file directly:
101
+
102
+ - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
103
+ - Windows: `%APPDATA%\Claude\claude_desktop_config.json`
104
+
105
+ ```json
106
+ {
107
+ "mcpServers": {
108
+ "toss-invest": {
109
+ "command": "npx",
110
+ "args": ["-y", "@nukeguys/toss-invest-mcp"],
111
+ "env": {
112
+ "TOSS_CLIENT_ID": "...",
113
+ "TOSS_CLIENT_SECRET": "..."
114
+ }
115
+ }
116
+ }
117
+ }
118
+ ```
119
+
120
+ Restart Claude Desktop after saving. See Anthropic's
121
+ [local MCP server guide](https://support.anthropic.com/en/articles/10949351-getting-started-with-local-mcp-servers-on-claude-desktop).
122
+
123
+ ## Claude Code
124
+
125
+ Add the same server to the user scope:
126
+
127
+ ```sh
128
+ claude mcp add-json --scope user toss-invest '{
129
+ "type": "stdio",
130
+ "command": "npx",
131
+ "args": ["-y", "@nukeguys/toss-invest-mcp"],
132
+ "env": {
133
+ "TOSS_CLIENT_ID": "...",
134
+ "TOSS_CLIENT_SECRET": "..."
135
+ }
136
+ }'
137
+ ```
138
+
139
+ Verify it with `claude mcp get toss-invest`. See the
140
+ [Claude Code MCP documentation](https://docs.anthropic.com/en/docs/claude-code/mcp).
141
+
142
+ ## Cursor
143
+
144
+ Create `~/.cursor/mcp.json` for global use, or `.cursor/mcp.json` in a project:
145
+
146
+ ```json
147
+ {
148
+ "mcpServers": {
149
+ "toss-invest": {
150
+ "command": "npx",
151
+ "args": ["-y", "@nukeguys/toss-invest-mcp"],
152
+ "env": {
153
+ "TOSS_CLIENT_ID": "...",
154
+ "TOSS_CLIENT_SECRET": "..."
155
+ }
156
+ }
157
+ }
158
+ }
159
+ ```
160
+
161
+ See the [Cursor MCP documentation](https://docs.cursor.com/context/model-context-protocol).
162
+
163
+ ## Visual Studio Code with GitHub Copilot
164
+
165
+ Create `.vscode/mcp.json` in a project, or run **MCP: Open User Configuration** for global use:
166
+
167
+ ```json
168
+ {
169
+ "servers": {
170
+ "toss-invest": {
171
+ "type": "stdio",
172
+ "command": "npx",
173
+ "args": ["-y", "@nukeguys/toss-invest-mcp"],
174
+ "env": {
175
+ "TOSS_CLIENT_ID": "...",
176
+ "TOSS_CLIENT_SECRET": "..."
177
+ }
178
+ }
179
+ }
180
+ }
181
+ ```
182
+
183
+ See the [VS Code MCP server documentation](https://code.visualstudio.com/docs/agent-customization/mcp-servers).
184
+
185
+ ## Windsurf
186
+
187
+ Open the MCP settings and select **View Raw Config**, or edit
188
+ `~/.codeium/windsurf/mcp_config.json`:
189
+
190
+ ```json
191
+ {
192
+ "mcpServers": {
193
+ "toss-invest": {
194
+ "command": "npx",
195
+ "args": ["-y", "@nukeguys/toss-invest-mcp"],
196
+ "env": {
197
+ "TOSS_CLIENT_ID": "...",
198
+ "TOSS_CLIENT_SECRET": "..."
199
+ }
200
+ }
201
+ }
202
+ }
203
+ ```
204
+
205
+ Refresh the MCP list after saving. See the
206
+ [Windsurf MCP documentation](https://docs.windsurf.com/windsurf/cascade/mcp).
207
+
208
+ ## Gemini CLI
209
+
210
+ Add the server to `~/.gemini/settings.json` for global use or `.gemini/settings.json` for a
211
+ project:
212
+
213
+ ```json
214
+ {
215
+ "mcpServers": {
216
+ "toss-invest": {
217
+ "command": "npx",
218
+ "args": ["-y", "@nukeguys/toss-invest-mcp"],
219
+ "env": {
220
+ "TOSS_CLIENT_ID": "...",
221
+ "TOSS_CLIENT_SECRET": "..."
222
+ },
223
+ "trust": false
224
+ }
225
+ }
226
+ }
227
+ ```
228
+
229
+ Verify it with `gemini mcp list`. See the
230
+ [Gemini CLI MCP documentation](https://github.com/google-gemini/gemini-cli/blob/main/docs/tools/mcp-server.md).
231
+
232
+ ## Local development
233
+
234
+ Clone the repository, create `.env` from `.env.example`, and build both packages:
235
+
236
+ ```sh
237
+ cp .env.example .env
238
+ pnpm mcp:build
239
+ pnpm mcp:inspect
240
+ ```
241
+
242
+ The host examples above store credentials in their configuration files. Keep those files private
243
+ and do not commit project-level MCP configuration containing real credentials.
244
+
245
+ ## Publishing
246
+
247
+ The GitHub Actions workflow `.github/workflows/publish.yml` publishes the SDK, MCP package,
248
+ and MCP Registry entry when a `vX.Y.Z` tag is pushed. All package and registry versions must
249
+ match the tag. It can also be run manually from GitHub Actions with an existing release tag,
250
+ which is useful after a partial failure or for a tag pushed before the workflow existed.
251
+
252
+ Before running it, configure a GitHub Actions trusted publisher for **each** npm package under
253
+ its npm package settings: owner `nukeguys`, repository `toss-invest-sdk`, workflow filename
254
+ `publish.yml`, and allow `npm publish`. Complete the first publish within two days of creating
255
+ the trusted publisher. No npm token or MCP Registry secret is needed. The workflow checks each
256
+ published version before continuing. It submits both packages before waiting for npm validation;
257
+ MCP Registry registration requires the MCP version to be publicly available.
258
+
259
+ For release notifications, create a Slack incoming webhook for the target channel and save its
260
+ URL as the GitHub Actions repository secret `SLACK_WEBHOOK_URL`. The notification includes the
261
+ release tag, result, and workflow run link. A missing or invalid webhook fails the notification
262
+ job without changing the result of the publish job.
263
+
264
+ For a manual release, publish the SDK first, then the MCP package and Registry entry. The last
265
+ command requires a prior `mcp-publisher login github`:
266
+
267
+ ```sh
268
+ pnpm --filter @nukeguys/toss-invest-sdk publish
269
+ pnpm --filter @nukeguys/toss-invest-mcp publish
270
+ pnpm mcp:publish
271
+ ```
272
+
273
+ ## Safety notes
274
+
275
+ - The MCP server is local-only and starts one authenticated Toss client per host process.
276
+ - Trading tools are absent unless `--allow-trading` is set.
277
+ - `confirmHighValueOrder: true` is rejected unless `--allow-high-value-orders` is also set.
278
+ - It does not log to stdout because stdout is reserved for MCP messages.
279
+ - Token issuance, caching, expiry refresh, and concurrent request deduplication remain handled by
280
+ `createTossInvestClient`.
281
+ - MCP inputs reuse the SDK's generated Zod schemas; MCP-specific account mapping, trading
282
+ permissions, and cross-field order rules are validated by the server.
283
+ - A `401` response is never retried automatically, including for order-history requests.
284
+ - Order creation, modification, and cancellation are never retried automatically.
285
+ - Local contributors must rebuild with `pnpm mcp:build` after changing either the SDK or MCP source.
package/dist/server.js ADDED
@@ -0,0 +1,656 @@
1
+ import { McpServer } from '@modelcontextprotocol/server';
2
+ import { zConditionRequest, zCreateConditionalOrderBody, zCreateOrderBody, zGetBuyingPowerQuery, zGetCandlesQuery, zGetConditionalOrderPath, zGetConditionalOrdersQuery, zGetExchangeRateQuery, zGetHoldingsQuery, zGetInvestorTradingRankingsQuery, zGetKrMarketCalendarQuery, zGetMarketIndicatorCandlesPath, zGetMarketIndicatorCandlesQuery, zGetMarketIndicatorInvestorTradingPath, zGetMarketIndicatorInvestorTradingQuery, zGetOrderbookQuery, zGetOrderPath, zGetOrdersQuery, zGetPriceLimitQuery, zGetRankingsQuery, zGetSectorEtfsPath, zGetSectorEtfsQuery, zGetSectorPath, zGetSectorQuery, zGetSectorRankingsQuery, zGetSectorStocksPath, zGetSectorStocksQuery, zGetSellableQuantityQuery, zGetStockCreditTradesPath, zGetStockCreditTradesQuery, zGetStockInvestorTradingPath, zGetStockInvestorTradingQuery, zGetStockProgramTradesPath, zGetStockProgramTradesQuery, zGetStockSecuritiesLendingPath, zGetStockSecuritiesLendingQuery, zGetStockShortSellingPath, zGetStockShortSellingQuery, zGetStockWarningsPath, zGetTradesQuery, zGetTransactionsQuery, zGetUsMarketCalendarQuery, zListStocksQuery, zModifyConditionalOrderBody, zModifyOrderBody, } from '@nukeguys/toss-invest-sdk';
3
+ import { z } from 'zod';
4
+ const [quantityOrderBody, amountOrderBody] = zCreateOrderBody.options;
5
+ const symbol = zGetOrderbookQuery.shape.symbol;
6
+ const symbols = z.array(symbol).min(1).max(200);
7
+ const indicatorSymbol = zGetMarketIndicatorCandlesPath.shape.symbol;
8
+ const indicatorSymbols = z.array(indicatorSymbol).min(1).max(200);
9
+ const accountSeq = z.number().int().positive();
10
+ const identifier = zGetOrderPath.shape.orderId.min(1);
11
+ const positiveDecimal = zConditionRequest.shape.triggerPrice.refine((value) => Number(value) > 0, '0보다 큰 값이어야 합니다.');
12
+ const clientOrderId = quantityOrderBody.shape.clientOrderId.unwrap().min(1);
13
+ const readOnly = {
14
+ destructiveHint: false,
15
+ idempotentHint: true,
16
+ openWorldHint: true,
17
+ readOnlyHint: true,
18
+ };
19
+ const trading = {
20
+ destructiveHint: true,
21
+ idempotentHint: false,
22
+ openWorldHint: true,
23
+ readOnlyHint: false,
24
+ };
25
+ const orderInput = z
26
+ .object({
27
+ accountSeq,
28
+ clientOrderId,
29
+ confirmHighValueOrder: quantityOrderBody.shape.confirmHighValueOrder.describe('1억원 이상 주문 확인. --allow-high-value-orders 권한이 필요합니다.'),
30
+ orderAmount: amountOrderBody.shape.orderAmount
31
+ .refine((value) => Number(value) > 0, '0보다 큰 값이어야 합니다.')
32
+ .optional(),
33
+ orderType: quantityOrderBody.shape.orderType,
34
+ price: positiveDecimal.optional(),
35
+ quantity: positiveDecimal.optional(),
36
+ side: quantityOrderBody.shape.side,
37
+ symbol,
38
+ timeInForce: quantityOrderBody.shape.timeInForce,
39
+ })
40
+ .superRefine(({ orderAmount, orderType, price, quantity, timeInForce }, context) => {
41
+ if ((quantity === undefined) === (orderAmount === undefined)) {
42
+ context.addIssue({
43
+ code: 'custom',
44
+ message: 'quantity와 orderAmount 중 정확히 하나를 입력해야 합니다.',
45
+ path: ['quantity'],
46
+ });
47
+ }
48
+ if (orderType === 'LIMIT' && price === undefined) {
49
+ context.addIssue({
50
+ code: 'custom',
51
+ message: '지정가 주문에는 price가 필요합니다.',
52
+ path: ['price'],
53
+ });
54
+ }
55
+ if (orderType === 'MARKET' && price !== undefined) {
56
+ context.addIssue({
57
+ code: 'custom',
58
+ message: '시장가 주문에는 price를 입력할 수 없습니다.',
59
+ path: ['price'],
60
+ });
61
+ }
62
+ if (orderAmount !== undefined && (orderType !== 'MARKET' || timeInForce !== undefined)) {
63
+ context.addIssue({
64
+ code: 'custom',
65
+ message: '금액 주문은 MARKET 주문이며 timeInForce를 사용할 수 없습니다.',
66
+ path: ['orderAmount'],
67
+ });
68
+ }
69
+ });
70
+ const modifyOrderInput = z
71
+ .object({
72
+ accountSeq,
73
+ confirmHighValueOrder: zModifyOrderBody.shape.confirmHighValueOrder.describe('1억원 이상 주문 확인. --allow-high-value-orders 권한이 필요합니다.'),
74
+ orderId: identifier,
75
+ orderType: zModifyOrderBody.shape.orderType,
76
+ price: positiveDecimal.optional(),
77
+ quantity: zModifyOrderBody.shape.quantity
78
+ .unwrap()
79
+ .refine((value) => Number(value) > 0, '0보다 큰 값이어야 합니다.')
80
+ .optional(),
81
+ })
82
+ .superRefine(({ orderType, price }, context) => {
83
+ if (orderType === 'LIMIT' && price === undefined) {
84
+ context.addIssue({
85
+ code: 'custom',
86
+ message: '지정가 정정에는 price가 필요합니다.',
87
+ path: ['price'],
88
+ });
89
+ }
90
+ if (orderType === 'MARKET' && price !== undefined) {
91
+ context.addIssue({
92
+ code: 'custom',
93
+ message: '시장가 정정에는 price를 입력할 수 없습니다.',
94
+ path: ['price'],
95
+ });
96
+ }
97
+ });
98
+ const condition = zConditionRequest.extend({
99
+ orderPrice: positiveDecimal.optional(),
100
+ triggerPrice: positiveDecimal,
101
+ });
102
+ function validateConditionalOrder(value, context) {
103
+ if ((value.type === 'SINGLE') === (value.second !== undefined)) {
104
+ context.addIssue({
105
+ code: 'custom',
106
+ message: 'SINGLE은 second를 생략하고 OCO/OTO는 second를 입력해야 합니다.',
107
+ path: ['second'],
108
+ });
109
+ }
110
+ if (value.orderType === 'MARKET' && value.type !== 'SINGLE') {
111
+ context.addIssue({
112
+ code: 'custom',
113
+ message: 'OCO/OTO 조건주문은 LIMIT만 지원합니다.',
114
+ path: ['orderType'],
115
+ });
116
+ }
117
+ for (const [name, leg] of [
118
+ ['first', value.first],
119
+ ['second', value.second],
120
+ ]) {
121
+ if (value.orderType === 'LIMIT' && leg?.orderPrice === undefined) {
122
+ context.addIssue({
123
+ code: 'custom',
124
+ message: 'LIMIT 조건에는 orderPrice가 필요합니다.',
125
+ path: [name, 'orderPrice'],
126
+ });
127
+ }
128
+ if (value.orderType === 'MARKET' && leg?.orderPrice !== undefined) {
129
+ context.addIssue({
130
+ code: 'custom',
131
+ message: 'MARKET 조건에는 orderPrice를 입력할 수 없습니다.',
132
+ path: [name, 'orderPrice'],
133
+ });
134
+ }
135
+ }
136
+ }
137
+ const createConditionalOrderInput = z
138
+ .object({
139
+ accountSeq,
140
+ ...zCreateConditionalOrderBody.shape,
141
+ clientOrderId,
142
+ confirmHighValueOrder: zCreateConditionalOrderBody.shape.confirmHighValueOrder.describe('1억원 이상 주문 확인. --allow-high-value-orders 권한이 필요합니다.'),
143
+ first: condition,
144
+ quantity: positiveDecimal,
145
+ second: condition.optional(),
146
+ })
147
+ .superRefine(validateConditionalOrder);
148
+ const modifyConditionalOrderInput = z
149
+ .object({
150
+ accountSeq,
151
+ ...zModifyConditionalOrderBody.shape,
152
+ conditionalOrderId: zGetConditionalOrderPath.shape.conditionalOrderId.min(1),
153
+ confirmHighValueOrder: zModifyConditionalOrderBody.shape.confirmHighValueOrder.describe('1억원 이상 주문 확인. --allow-high-value-orders 권한이 필요합니다.'),
154
+ first: condition,
155
+ quantity: positiveDecimal,
156
+ second: condition.optional(),
157
+ })
158
+ .superRefine(validateConditionalOrder);
159
+ function result(value) {
160
+ return {
161
+ content: [{ type: 'text', text: JSON.stringify(value ?? null, null, 2) }],
162
+ };
163
+ }
164
+ async function call(request) {
165
+ try {
166
+ const { data } = await request();
167
+ return result(data && typeof data === 'object' && 'result' in data ? data.result : data);
168
+ }
169
+ catch (error) {
170
+ return {
171
+ content: [
172
+ {
173
+ type: 'text',
174
+ text: error instanceof Error ? error.message : JSON.stringify(error) || 'Unknown error',
175
+ },
176
+ ],
177
+ isError: true,
178
+ };
179
+ }
180
+ }
181
+ function assertHighValuePermission(allowed, requested) {
182
+ if (requested && !allowed) {
183
+ throw new Error('고액 주문은 --allow-high-value-orders 옵션으로 서버를 시작해야 합니다.');
184
+ }
185
+ }
186
+ export function createTossInvestMcpServer(client, { allowHighValueOrders = false, allowTrading = false } = {}) {
187
+ if (allowHighValueOrders && !allowTrading) {
188
+ throw new TypeError('allowHighValueOrders requires allowTrading');
189
+ }
190
+ const server = new McpServer({ name: 'toss-invest', version: '0.4.3' }, {
191
+ instructions: allowTrading
192
+ ? '토스증권 조회 및 주문 서버입니다. 계좌 API를 호출하기 전에 toss_list_accounts로 accountSeq를 확인하고, 주문 도구는 사용자의 승인을 받은 경우에만 호출하세요.'
193
+ : '토스증권 조회 전용 서버입니다. 계좌 API를 호출하기 전에 toss_list_accounts로 accountSeq를 확인하세요.',
194
+ });
195
+ server.registerTool('toss_get_prices', {
196
+ annotations: readOnly,
197
+ description: '국내 또는 미국 종목의 현재가를 최대 200개까지 조회합니다.',
198
+ inputSchema: z.object({
199
+ symbols: symbols.describe('종목 심볼 목록. 예: ["005930", "AAPL"]'),
200
+ }),
201
+ title: '종목 현재가 조회',
202
+ }, ({ symbols }) => call(() => client.getPrices({ query: { symbols: symbols.join(',') }, throwOnError: true })));
203
+ server.registerTool('toss_get_trades', {
204
+ annotations: readOnly,
205
+ description: '한 종목의 최근 체결 내역을 최대 50건까지 조회합니다.',
206
+ inputSchema: zGetTradesQuery,
207
+ title: '최근 체결 조회',
208
+ }, ({ count, symbol }) => call(() => client.getTrades({ query: { count, symbol }, throwOnError: true })));
209
+ server.registerTool('toss_get_price_limit', {
210
+ annotations: readOnly,
211
+ description: '한 종목의 당일 가격 제한 정보를 조회합니다.',
212
+ inputSchema: zGetPriceLimitQuery,
213
+ title: '가격 제한 조회',
214
+ }, ({ symbol }) => call(() => client.getPriceLimit({ query: { symbol }, throwOnError: true })));
215
+ server.registerTool('toss_get_orderbook', {
216
+ annotations: readOnly,
217
+ description: '한 종목의 매수·매도 호가와 잔량을 조회합니다.',
218
+ inputSchema: zGetOrderbookQuery,
219
+ title: '종목 호가 조회',
220
+ }, ({ symbol }) => call(() => client.getOrderbook({ query: { symbol }, throwOnError: true })));
221
+ server.registerTool('toss_get_candles', {
222
+ annotations: readOnly,
223
+ description: '한 종목의 분봉 또는 일봉 OHLCV 데이터를 최대 200개까지 조회합니다. 캔들은 최신순(timestamp 내림차순)으로 정렬되며, 1분봉의 timestamp는 봉 종료 시각, 일봉은 해당 거래일 자정입니다.',
224
+ inputSchema: zGetCandlesQuery,
225
+ title: '종목 캔들 조회',
226
+ }, ({ adjusted, before, count, interval, symbol }) => call(() => client.getCandles({
227
+ query: { adjusted, before, count, interval, symbol },
228
+ throwOnError: true,
229
+ })));
230
+ server.registerTool('toss_get_stocks', {
231
+ annotations: readOnly,
232
+ description: '국내 또는 미국 종목의 이름, 시장, 통화, 거래 상태 등 기본 정보를 조회합니다.',
233
+ inputSchema: z.object({
234
+ symbols: symbols.describe('종목 심볼 목록. 예: ["005930", "AAPL"]'),
235
+ }),
236
+ title: '종목 기본 정보 조회',
237
+ }, ({ symbols }) => call(() => client.getStocks({ query: { symbols: symbols.join(',') }, throwOnError: true })));
238
+ server.registerTool('toss_list_stocks', {
239
+ annotations: readOnly,
240
+ description: '마켓(거래소)별 전체 종목 목록을 조회합니다. 유니버스 구성 용도이며 마켓당 최대 수천 건을 한 번에 반환하므로, 개별 종목 정보는 toss_get_stocks를 사용하세요.',
241
+ inputSchema: zListStocksQuery,
242
+ title: '마켓 전체 종목 조회',
243
+ }, ({ commonShare, market, securityType, status }) => call(() => client.listStocks({
244
+ query: { commonShare, market, securityType, status },
245
+ throwOnError: true,
246
+ })));
247
+ server.registerTool('toss_get_stock_warnings', {
248
+ annotations: readOnly,
249
+ description: '한 종목의 투자경고, 거래정지 등 투자 유의사항을 조회합니다.',
250
+ inputSchema: zGetStockWarningsPath,
251
+ title: '종목 유의사항 조회',
252
+ }, ({ symbol }) => call(() => client.getStockWarnings({ path: { symbol }, throwOnError: true })));
253
+ server.registerTool('toss_get_stock_investor_trading', {
254
+ annotations: readOnly,
255
+ description: '국내 종목의 개인·외국인·기관·기타법인 투자자별 매매 거래량을 일별 시계열로 조회합니다.',
256
+ inputSchema: z.object({
257
+ ...zGetStockInvestorTradingPath.shape,
258
+ ...zGetStockInvestorTradingQuery.shape,
259
+ }),
260
+ title: '투자자별 매매동향 조회',
261
+ }, ({ count, symbol, until }) => call(() => client.getStockInvestorTrading({
262
+ path: { symbol },
263
+ query: { count, until },
264
+ throwOnError: true,
265
+ })));
266
+ server.registerTool('toss_get_stock_program_trades', {
267
+ annotations: readOnly,
268
+ description: '국내 종목의 차익·비차익 프로그램매매 거래량을 일별 시계열로 조회합니다.',
269
+ inputSchema: z.object({
270
+ ...zGetStockProgramTradesPath.shape,
271
+ ...zGetStockProgramTradesQuery.shape,
272
+ }),
273
+ title: '프로그램매매 동향 조회',
274
+ }, ({ count, symbol, until }) => call(() => client.getStockProgramTrades({
275
+ path: { symbol },
276
+ query: { count, until },
277
+ throwOnError: true,
278
+ })));
279
+ server.registerTool('toss_get_stock_short_selling', {
280
+ annotations: readOnly,
281
+ description: '국내 종목의 공매도 거래량·거래대금과 전체 거래 대비 비중을 일별 시계열로 조회합니다.',
282
+ inputSchema: z.object({
283
+ ...zGetStockShortSellingPath.shape,
284
+ ...zGetStockShortSellingQuery.shape,
285
+ }),
286
+ title: '공매도 동향 조회',
287
+ }, ({ count, symbol, until }) => call(() => client.getStockShortSelling({
288
+ path: { symbol },
289
+ query: { count, until },
290
+ throwOnError: true,
291
+ })));
292
+ server.registerTool('toss_get_stock_credit_trades', {
293
+ annotations: readOnly,
294
+ description: '국내 종목의 신용융자·신용대주 신규·상환·잔고 수량을 일별 시계열로 조회합니다.',
295
+ inputSchema: z.object({
296
+ ...zGetStockCreditTradesPath.shape,
297
+ ...zGetStockCreditTradesQuery.shape,
298
+ }),
299
+ title: '신용거래 동향 조회',
300
+ }, ({ count, symbol, until }) => call(() => client.getStockCreditTrades({
301
+ path: { symbol },
302
+ query: { count, until },
303
+ throwOnError: true,
304
+ })));
305
+ server.registerTool('toss_get_stock_securities_lending', {
306
+ annotations: readOnly,
307
+ description: '국내 종목의 대차거래 체결·상환·잔고 수량과 잔고 금액을 일별 시계열로 조회합니다.',
308
+ inputSchema: z.object({
309
+ ...zGetStockSecuritiesLendingPath.shape,
310
+ ...zGetStockSecuritiesLendingQuery.shape,
311
+ }),
312
+ title: '대차거래 동향 조회',
313
+ }, ({ count, symbol, until }) => call(() => client.getStockSecuritiesLending({
314
+ path: { symbol },
315
+ query: { count, until },
316
+ throwOnError: true,
317
+ })));
318
+ server.registerTool('toss_get_exchange_rate', {
319
+ annotations: readOnly,
320
+ description: '원화와 달러 사이의 참고 환율을 조회합니다.',
321
+ inputSchema: zGetExchangeRateQuery,
322
+ title: '환율 조회',
323
+ }, ({ baseCurrency, dateTime, quoteCurrency }) => call(() => client.getExchangeRate({
324
+ query: { baseCurrency, dateTime, quoteCurrency },
325
+ throwOnError: true,
326
+ })));
327
+ server.registerTool('toss_get_kr_market_calendar', {
328
+ annotations: readOnly,
329
+ description: '기준일의 국내 시장 운영 시간과 거래 가능 여부를 조회합니다.',
330
+ inputSchema: zGetKrMarketCalendarQuery,
331
+ title: '국내 장 운영 정보 조회',
332
+ }, ({ date }) => call(() => client.getKrMarketCalendar({ query: { date }, throwOnError: true })));
333
+ server.registerTool('toss_get_us_market_calendar', {
334
+ annotations: readOnly,
335
+ description: '기준일의 미국 시장 운영 시간과 거래 가능 여부를 조회합니다.',
336
+ inputSchema: zGetUsMarketCalendarQuery,
337
+ title: '미국 장 운영 정보 조회',
338
+ }, ({ date }) => call(() => client.getUsMarketCalendar({ query: { date }, throwOnError: true })));
339
+ server.registerTool('toss_get_rankings', {
340
+ annotations: readOnly,
341
+ description: '시장 또는 토스증권 기준 거래대금, 거래량, 등락률 순위를 조회합니다.',
342
+ inputSchema: zGetRankingsQuery,
343
+ title: '주식 랭킹 조회',
344
+ }, ({ count, duration, excludeInvestmentCaution, marketCountry, type }) => call(() => client.getRankings({
345
+ query: { count, duration, excludeInvestmentCaution, marketCountry, type },
346
+ throwOnError: true,
347
+ })));
348
+ server.registerTool('toss_get_investor_trading_rankings', {
349
+ annotations: readOnly,
350
+ description: '국내 종목의 투자자별 순매수·순매도 랭킹을 조회합니다.',
351
+ inputSchema: zGetInvestorTradingRankingsQuery,
352
+ title: '투자자별 매매 랭킹 조회',
353
+ }, (query) => call(() => client.getInvestorTradingRankings({ query, throwOnError: true })));
354
+ server.registerTool('toss_list_sectors', {
355
+ annotations: readOnly,
356
+ description: '섹터 목록과 계층을 조회합니다.',
357
+ inputSchema: z.object({}),
358
+ title: '섹터 목록 조회',
359
+ }, () => call(() => client.listSectors({ throwOnError: true })));
360
+ server.registerTool('toss_get_sector_rankings', {
361
+ annotations: readOnly,
362
+ description: '시장과 기간별 섹터 랭킹을 조회합니다.',
363
+ inputSchema: zGetSectorRankingsQuery,
364
+ title: '섹터 랭킹 조회',
365
+ }, (query) => call(() => client.getSectorRankings({ query, throwOnError: true })));
366
+ server.registerTool('toss_get_sector', {
367
+ annotations: readOnly,
368
+ description: '섹터 정보와 기간별 등락률을 조회합니다. 섹터 ID는 toss_list_sectors에서 확인하세요.',
369
+ inputSchema: z.object({ ...zGetSectorPath.shape, ...zGetSectorQuery.shape }),
370
+ title: '섹터 상세 조회',
371
+ }, ({ sectorId, marketCountry }) => call(() => client.getSector({ path: { sectorId }, query: { marketCountry }, throwOnError: true })));
372
+ server.registerTool('toss_get_sector_stocks', {
373
+ annotations: readOnly,
374
+ description: '하위 섹터를 포함한 구성 주식을 조회합니다. 섹터 ID는 toss_list_sectors에서 확인하세요.',
375
+ inputSchema: z.object({ ...zGetSectorStocksPath.shape, ...zGetSectorStocksQuery.shape }),
376
+ title: '섹터 구성 주식 조회',
377
+ }, ({ sectorId, marketCountry }) => call(() => client.getSectorStocks({
378
+ path: { sectorId },
379
+ query: { marketCountry },
380
+ throwOnError: true,
381
+ })));
382
+ server.registerTool('toss_get_sector_etfs', {
383
+ annotations: readOnly,
384
+ description: '해당 섹터의 관련 ETF을 조회합니다. 섹터 ID는 toss_list_sectors에서 확인하세요.',
385
+ inputSchema: z.object({ ...zGetSectorEtfsPath.shape, ...zGetSectorEtfsQuery.shape }),
386
+ title: '섹터 관련 ETF 조회',
387
+ }, ({ sectorId, marketCountry }) => call(() => client.getSectorEtfs({ path: { sectorId }, query: { marketCountry }, throwOnError: true })));
388
+ server.registerTool('toss_get_market_indicator_prices', {
389
+ annotations: readOnly,
390
+ description: '국내 지수와 국채 등 시장 지표의 현재가를 최대 200개까지 조회합니다.',
391
+ inputSchema: z.object({ symbols: indicatorSymbols }),
392
+ title: '시장 지표 현재가 조회',
393
+ }, ({ symbols }) => call(() => client.getMarketIndicatorPrices({
394
+ query: { symbols: symbols.join(',') },
395
+ throwOnError: true,
396
+ })));
397
+ server.registerTool('toss_get_market_indicator_candles', {
398
+ annotations: readOnly,
399
+ description: '한 시장 지표의 분봉 또는 일봉 데이터를 최대 200개까지 조회합니다. 캔들은 최신순(timestamp 내림차순)으로 정렬되며, 1분봉의 timestamp는 봉 종료 시각, 일봉은 해당 거래일 자정입니다.',
400
+ inputSchema: z.object({
401
+ ...zGetMarketIndicatorCandlesPath.shape,
402
+ ...zGetMarketIndicatorCandlesQuery.shape,
403
+ }),
404
+ title: '시장 지표 캔들 조회',
405
+ }, ({ before, count, interval, symbol }) => call(() => client.getMarketIndicatorCandles({
406
+ path: { symbol },
407
+ query: { before, count, interval },
408
+ throwOnError: true,
409
+ })));
410
+ server.registerTool('toss_get_market_indicator_investor_trading', {
411
+ annotations: readOnly,
412
+ description: '코스피 또는 코스닥의 투자자별 매매대금을 조회합니다.',
413
+ inputSchema: z.object({
414
+ ...zGetMarketIndicatorInvestorTradingPath.shape,
415
+ ...zGetMarketIndicatorInvestorTradingQuery.shape,
416
+ }),
417
+ title: '투자자별 매매대금 조회',
418
+ }, ({ count, interval, symbol, until }) => call(() => client.getMarketIndicatorInvestorTrading({
419
+ path: { symbol },
420
+ query: { count, interval, until },
421
+ throwOnError: true,
422
+ })));
423
+ server.registerTool('toss_list_accounts', {
424
+ annotations: readOnly,
425
+ description: '사용 가능한 토스증권 종합매매 계좌와 accountSeq를 조회합니다.',
426
+ inputSchema: z.object({}),
427
+ title: '계좌 목록 조회',
428
+ }, () => call(() => client.getAccounts({ throwOnError: true })));
429
+ server.registerTool('toss_get_holdings', {
430
+ annotations: readOnly,
431
+ description: '선택한 계좌의 국내·미국 보유 주식과 평가 정보를 조회합니다.',
432
+ inputSchema: z.object({
433
+ accountSeq: accountSeq.describe('toss_list_accounts가 반환한 accountSeq'),
434
+ ...zGetHoldingsQuery.shape,
435
+ }),
436
+ title: '보유 주식 조회',
437
+ }, ({ accountSeq, symbol }) => call(() => client.getHoldings({
438
+ headers: { 'X-Tossinvest-Account': accountSeq },
439
+ query: { symbol },
440
+ throwOnError: true,
441
+ })));
442
+ server.registerTool('toss_get_transactions', {
443
+ annotations: readOnly,
444
+ description: '계좌의 매매·입출금·환전·배당 등 거래내역을 조회합니다. 다음 페이지는 hasNext와 nextCursor로 확인하세요.',
445
+ inputSchema: z.object({
446
+ accountSeq: accountSeq.describe('toss_list_accounts가 반환한 accountSeq'),
447
+ ...zGetTransactionsQuery.shape,
448
+ }),
449
+ title: '계좌 거래내역 조회',
450
+ }, ({ accountSeq, ...query }) => call(() => client.getTransactions({
451
+ headers: { 'X-Tossinvest-Account': accountSeq },
452
+ query,
453
+ throwOnError: true,
454
+ })));
455
+ server.registerTool('toss_list_orders', {
456
+ annotations: readOnly,
457
+ description: '선택한 계좌의 진행 중이거나 종료된 주문 내역을 조회합니다.',
458
+ inputSchema: z.object({
459
+ accountSeq: accountSeq.describe('toss_list_accounts가 반환한 accountSeq'),
460
+ ...zGetOrdersQuery.shape,
461
+ }),
462
+ title: '주문 내역 조회',
463
+ }, ({ accountSeq, cursor, from, limit, status, symbol, to }) => call(() => client.getOrders({
464
+ headers: { 'X-Tossinvest-Account': accountSeq },
465
+ query: { cursor, from, limit, status, symbol, to },
466
+ throwOnError: true,
467
+ })));
468
+ server.registerTool('toss_get_order', {
469
+ annotations: readOnly,
470
+ description: '선택한 계좌의 주문 한 건을 상세 조회합니다.',
471
+ inputSchema: z.object({ accountSeq, ...zGetOrderPath.shape }),
472
+ title: '주문 상세 조회',
473
+ }, ({ accountSeq, orderId }) => call(() => client.getOrder({
474
+ headers: { 'X-Tossinvest-Account': accountSeq },
475
+ path: { orderId },
476
+ throwOnError: true,
477
+ })));
478
+ server.registerTool('toss_list_conditional_orders', {
479
+ annotations: readOnly,
480
+ description: '선택한 계좌의 진행 중이거나 종료된 조건주문 목록을 조회합니다.',
481
+ inputSchema: z.object({
482
+ accountSeq,
483
+ ...zGetConditionalOrdersQuery.shape,
484
+ }),
485
+ title: '조건주문 목록 조회',
486
+ }, ({ accountSeq, cursor, limit, status, symbol }) => call(() => client.getConditionalOrders({
487
+ headers: { 'X-Tossinvest-Account': accountSeq },
488
+ query: { cursor, limit, status, symbol },
489
+ throwOnError: true,
490
+ })));
491
+ server.registerTool('toss_get_conditional_order', {
492
+ annotations: readOnly,
493
+ description: '선택한 계좌의 조건주문 한 건을 상세 조회합니다.',
494
+ inputSchema: z.object({ accountSeq, ...zGetConditionalOrderPath.shape }),
495
+ title: '조건주문 상세 조회',
496
+ }, ({ accountSeq, conditionalOrderId }) => call(() => client.getConditionalOrder({
497
+ headers: { 'X-Tossinvest-Account': accountSeq },
498
+ path: { conditionalOrderId },
499
+ throwOnError: true,
500
+ })));
501
+ server.registerTool('toss_get_buying_power', {
502
+ annotations: readOnly,
503
+ description: '선택한 계좌에서 원화 또는 달러로 주문 가능한 현금 기반 금액을 조회합니다.',
504
+ inputSchema: z.object({
505
+ accountSeq: accountSeq.describe('toss_list_accounts가 반환한 accountSeq'),
506
+ ...zGetBuyingPowerQuery.shape,
507
+ }),
508
+ title: '매수 가능 금액 조회',
509
+ }, ({ accountSeq, currency }) => call(() => client.getBuyingPower({
510
+ headers: { 'X-Tossinvest-Account': accountSeq },
511
+ query: { currency },
512
+ throwOnError: true,
513
+ })));
514
+ server.registerTool('toss_get_sellable_quantity', {
515
+ annotations: readOnly,
516
+ description: '선택한 계좌에서 특정 종목을 매도할 수 있는 수량을 조회합니다.',
517
+ inputSchema: z.object({ accountSeq, ...zGetSellableQuantityQuery.shape }),
518
+ title: '매도 가능 수량 조회',
519
+ }, ({ accountSeq, symbol }) => call(() => client.getSellableQuantity({
520
+ headers: { 'X-Tossinvest-Account': accountSeq },
521
+ query: { symbol },
522
+ throwOnError: true,
523
+ })));
524
+ server.registerTool('toss_get_commissions', {
525
+ annotations: readOnly,
526
+ description: '선택한 계좌의 국내·미국 주식 매매 수수료를 조회합니다.',
527
+ inputSchema: z.object({ accountSeq }),
528
+ title: '매매 수수료 조회',
529
+ }, ({ accountSeq }) => call(() => client.getCommissions({
530
+ headers: { 'X-Tossinvest-Account': accountSeq },
531
+ throwOnError: true,
532
+ })));
533
+ if (allowTrading) {
534
+ server.registerTool('toss_create_order', {
535
+ annotations: trading,
536
+ description: '선택한 계좌에 매수 또는 매도 주문을 생성합니다. 호출 전에 주문 내용을 사용자에게 확인받아야 합니다.',
537
+ inputSchema: orderInput,
538
+ title: '주문 생성',
539
+ }, ({ accountSeq, clientOrderId, confirmHighValueOrder, orderAmount, orderType, price, quantity, side, symbol, timeInForce, }) => call(() => {
540
+ assertHighValuePermission(allowHighValueOrders, confirmHighValueOrder);
541
+ const body = orderAmount === undefined
542
+ ? {
543
+ clientOrderId,
544
+ confirmHighValueOrder,
545
+ orderType,
546
+ price,
547
+ quantity: quantity,
548
+ side,
549
+ symbol,
550
+ timeInForce,
551
+ }
552
+ : {
553
+ clientOrderId,
554
+ confirmHighValueOrder,
555
+ orderAmount,
556
+ orderType: 'MARKET',
557
+ side,
558
+ symbol,
559
+ };
560
+ return client.createOrder({
561
+ body,
562
+ headers: { 'X-Tossinvest-Account': accountSeq },
563
+ throwOnError: true,
564
+ });
565
+ }));
566
+ server.registerTool('toss_modify_order', {
567
+ annotations: trading,
568
+ description: '선택한 계좌의 기존 주문 가격 또는 수량을 정정합니다. 호출 전에 변경 내용을 사용자에게 확인받아야 합니다.',
569
+ inputSchema: modifyOrderInput,
570
+ title: '주문 정정',
571
+ }, ({ accountSeq, confirmHighValueOrder, orderId, orderType, price, quantity }) => call(() => {
572
+ assertHighValuePermission(allowHighValueOrders, confirmHighValueOrder);
573
+ const body = {
574
+ confirmHighValueOrder,
575
+ orderType,
576
+ price,
577
+ quantity,
578
+ };
579
+ return client.modifyOrder({
580
+ body,
581
+ headers: { 'X-Tossinvest-Account': accountSeq },
582
+ path: { orderId },
583
+ throwOnError: true,
584
+ });
585
+ }));
586
+ server.registerTool('toss_cancel_order', {
587
+ annotations: trading,
588
+ description: '선택한 계좌의 미체결 주문을 취소합니다. 호출 전에 취소 대상을 사용자에게 확인받아야 합니다.',
589
+ inputSchema: z.object({ accountSeq, orderId: identifier }),
590
+ title: '주문 취소',
591
+ }, ({ accountSeq, orderId }) => call(() => client.cancelOrder({
592
+ headers: { 'X-Tossinvest-Account': accountSeq },
593
+ path: { orderId },
594
+ throwOnError: true,
595
+ })));
596
+ server.registerTool('toss_create_conditional_order', {
597
+ annotations: trading,
598
+ description: '가격 조건 충족 시 주문을 실행하는 SINGLE, OCO 또는 OTO 조건주문을 등록합니다.',
599
+ inputSchema: createConditionalOrderInput,
600
+ title: '조건주문 생성',
601
+ }, ({ accountSeq, clientOrderId, confirmHighValueOrder, expireDate, first, orderType, quantity, second, symbol, type, }) => call(() => {
602
+ assertHighValuePermission(allowHighValueOrders, confirmHighValueOrder);
603
+ const body = {
604
+ clientOrderId,
605
+ confirmHighValueOrder,
606
+ expireDate,
607
+ first,
608
+ orderType,
609
+ quantity,
610
+ second,
611
+ symbol,
612
+ type,
613
+ };
614
+ return client.createConditionalOrder({
615
+ body,
616
+ headers: { 'X-Tossinvest-Account': accountSeq },
617
+ throwOnError: true,
618
+ });
619
+ }));
620
+ server.registerTool('toss_modify_conditional_order', {
621
+ annotations: trading,
622
+ description: '기존 조건주문을 취소하고 변경된 조건으로 다시 생성합니다. 응답의 새 ID를 사용해야 합니다.',
623
+ inputSchema: modifyConditionalOrderInput,
624
+ title: '조건주문 수정',
625
+ }, ({ accountSeq, conditionalOrderId, confirmHighValueOrder, expireDate, first, orderType, quantity, second, type, }) => call(() => {
626
+ assertHighValuePermission(allowHighValueOrders, confirmHighValueOrder);
627
+ const body = {
628
+ confirmHighValueOrder,
629
+ expireDate,
630
+ first,
631
+ orderType,
632
+ quantity,
633
+ second,
634
+ type,
635
+ };
636
+ return client.modifyConditionalOrder({
637
+ body,
638
+ headers: { 'X-Tossinvest-Account': accountSeq },
639
+ path: { conditionalOrderId },
640
+ throwOnError: true,
641
+ });
642
+ }));
643
+ server.registerTool('toss_cancel_conditional_order', {
644
+ annotations: trading,
645
+ description: '선택한 계좌의 진행 중인 조건주문을 취소합니다.',
646
+ inputSchema: z.object({ accountSeq, conditionalOrderId: identifier }),
647
+ title: '조건주문 취소',
648
+ }, ({ accountSeq, conditionalOrderId }) => call(() => client.cancelConditionalOrder({
649
+ headers: { 'X-Tossinvest-Account': accountSeq },
650
+ path: { conditionalOrderId },
651
+ throwOnError: true,
652
+ })));
653
+ }
654
+ return server;
655
+ }
656
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAML,iBAAiB,EACjB,2BAA2B,EAC3B,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,wBAAwB,EACxB,0BAA0B,EAC1B,qBAAqB,EACrB,iBAAiB,EACjB,gCAAgC,EAChC,yBAAyB,EACzB,8BAA8B,EAC9B,+BAA+B,EAC/B,sCAAsC,EACtC,uCAAuC,EACvC,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,EACrB,yBAAyB,EACzB,yBAAyB,EACzB,0BAA0B,EAC1B,4BAA4B,EAC5B,6BAA6B,EAC7B,0BAA0B,EAC1B,2BAA2B,EAC3B,8BAA8B,EAC9B,+BAA+B,EAC/B,yBAAyB,EACzB,0BAA0B,EAC1B,qBAAqB,EACrB,eAAe,EACf,qBAAqB,EACrB,yB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,CAAC;YACrE,KAAK,EAAE,SAAS;SACjB,EACD,CAAC,EAAE,UAAU,EAAE,kBAAkB,EAAE,EAAE,EAAE,CACrC,IAAI,CAAC,GAAG,EAAE,CACR,MAAM,CAAC,sBAAsB,CAAC;YAC5B,OAAO,EAAE,EAAE,sBAAsB,EAAE,UAAU,EAAE;YAC/C,IAAI,EAAE,EAAE,kBAAkB,EAAE;YAC5B,YAAY,EAAE,IAAI;SACnB,CAAC,CACH,CACJ,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
package/dist/stdio.js ADDED
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env node
2
+ import { StdioServerTransport } from '@modelcontextprotocol/server/stdio';
3
+ import { createTossInvestClient } from '@nukeguys/toss-invest-sdk';
4
+ import { createTossInvestMcpServer } from './server.js';
5
+ function requiredEnv(name) {
6
+ const value = process.env[name];
7
+ if (!value) {
8
+ throw new Error(`${name} is required`);
9
+ }
10
+ return value;
11
+ }
12
+ const client = createTossInvestClient({
13
+ clientId: requiredEnv('TOSS_CLIENT_ID'),
14
+ clientSecret: requiredEnv('TOSS_CLIENT_SECRET'),
15
+ });
16
+ const server = createTossInvestMcpServer(client, {
17
+ allowHighValueOrders: process.argv.includes('--allow-high-value-orders'),
18
+ allowTrading: process.argv.includes('--allow-trading'),
19
+ });
20
+ for (const signal of ['SIGINT', 'SIGTERM']) {
21
+ process.once(signal, () => {
22
+ void server.close().finally(() => process.exit());
23
+ });
24
+ }
25
+ await server.connect(new StdioServerTransport());
26
+ //# sourceMappingURL=stdio.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stdio.js","sourceRoot":"","sources":["../src/stdio.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAExD,SAAS,WAAW,CAAC,IAA6C;IAChE,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAChC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,cAAc,CAAC,CAAC;IACzC,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,MAAM,GAAG,sBAAsB,CAAC;IACpC,QAAQ,EAAE,WAAW,CAAC,gBAAgB,CAAC;IACvC,YAAY,EAAE,WAAW,CAAC,oBAAoB,CAAC;CAChD,CAAC,CAAC;AACH,MAAM,MAAM,GAAG,yBAAyB,CAAC,MAAM,EAAE;IAC/C,oBAAoB,EAAE,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,2BAA2B,CAAC;IACxE,YAAY,EAAE,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC;CACvD,CAAC,CAAC;AAEH,KAAK,MAAM,MAAM,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAU,EAAE,CAAC;IACpD,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE;QACxB,KAAK,MAAM,CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,oBAAoB,EAAE,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,46 @@
1
1
  {
2
2
  "name": "@nukeguys/toss-invest-mcp",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.4.3",
4
+ "mcpName": "io.github.nukeguys/toss-invest",
5
+ "description": "Local MCP server for the Toss Securities Open API",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/nukeguys/toss-invest-sdk.git",
10
+ "directory": "apps/mcp"
11
+ },
12
+ "homepage": "https://github.com/nukeguys/toss-invest-sdk#readme",
13
+ "bugs": "https://github.com/nukeguys/toss-invest-sdk/issues",
14
+ "keywords": [
15
+ "toss",
16
+ "securities",
17
+ "mcp",
18
+ "model-context-protocol"
19
+ ],
20
+ "type": "module",
21
+ "bin": {
22
+ "toss-invest-mcp": "./dist/stdio.js"
23
+ },
24
+ "files": [
25
+ "dist"
26
+ ],
27
+ "publishConfig": {
28
+ "access": "public"
29
+ },
30
+ "dependencies": {
31
+ "@modelcontextprotocol/server": "2.4.0",
32
+ "zod": "4.6.7",
33
+ "@nukeguys/toss-invest-sdk": "0.4.3"
34
+ },
35
+ "devDependencies": {
36
+ "@modelcontextprotocol/client": "2.4.0",
37
+ "@types/node": "26.6.6",
38
+ "typescript": "6.0.3"
39
+ },
40
+ "scripts": {
41
+ "build": "tsc -p tsconfig.json",
42
+ "typecheck": "tsc -p tsconfig.json --noEmit",
43
+ "test": "node --test",
44
+ "publish:registry": "mcp-publisher publish"
45
+ }
6
46
  }