tossinvest-mcp 0.3.0 → 0.3.1
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/README.md +3 -1
- package/dist/server.js +1 -1
- package/dist/tools/account.js +57 -1
- package/dist/tools/extended-market.js +10 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -45,12 +45,14 @@
|
|
|
45
45
|
- 매수 유의사항 조회
|
|
46
46
|
- 종목별 투자자·프로그램·공매도·신용거래·대차거래 동향 조회
|
|
47
47
|
- 주식 랭킹 조회
|
|
48
|
+
- 투자자별 순매수·순매도 랭킹 조회 (`toss_get_investor_trading_rankings`)
|
|
48
49
|
- 시장 지표 현재가·차트·투자자 매매동향 조회
|
|
49
50
|
- 섹터 목록·상세·랭킹·소속 주식·ETF 조회
|
|
50
51
|
- 환율 조회
|
|
51
52
|
- 국내/미국 장 운영 시간 조회
|
|
52
53
|
- 계좌 목록 조회
|
|
53
54
|
- 보유 주식 조회
|
|
55
|
+
- 매매·입출금·환전·배당 등 계좌 거래내역 조회 (`toss_get_transactions`)
|
|
54
56
|
- 매수 가능 금액 조회
|
|
55
57
|
- 판매 가능 수량 조회
|
|
56
58
|
- 매매 수수료 조회
|
|
@@ -67,7 +69,7 @@
|
|
|
67
69
|
- `toss_modify_conditional_order`: 조건주문 수정
|
|
68
70
|
- `toss_cancel_conditional_order`: 조건주문 취소
|
|
69
71
|
|
|
70
|
-
0.3.
|
|
72
|
+
0.3.1은 투자자별 순매수·순매도 랭킹과 계좌 거래내역 조회를 추가해 **조회 36개·거래 6개**를 제공합니다. 로컬 stdio 방식이며 WebSocket이나 원격 HTTP/SSE 서버는 제공하지 않습니다.
|
|
71
73
|
|
|
72
74
|
특징:
|
|
73
75
|
|
package/dist/server.js
CHANGED
|
@@ -8,7 +8,7 @@ import { registerOrderTools } from "./tools/orders.js";
|
|
|
8
8
|
export function createServer(config) {
|
|
9
9
|
const server = new McpServer({
|
|
10
10
|
name: "tossinvest-mcp",
|
|
11
|
-
version: "0.3.
|
|
11
|
+
version: "0.3.1",
|
|
12
12
|
});
|
|
13
13
|
const client = new TossClient(config);
|
|
14
14
|
setServerWarnings(server, config.warnings ?? []);
|
package/dist/tools/account.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
1
2
|
import { resolveAccountSeq } from "../config.js";
|
|
2
|
-
import { accountInputSchema, currencySchema, symbolSchema, } from "../toss/schemas.js";
|
|
3
|
+
import { accountInputSchema, accountDescription, currencySchema, dateSchema, symbolSchema, } from "../toss/schemas.js";
|
|
3
4
|
import { runTool, registrar } from "./common.js";
|
|
4
5
|
export function registerAccountTools(server, client, config) {
|
|
5
6
|
const register = registrar(server);
|
|
@@ -20,6 +21,61 @@ export function registerAccountTools(server, client, config) {
|
|
|
20
21
|
accountSeq: resolveAccountSeq(accountSeq, config.defaultAccountSeq),
|
|
21
22
|
query: { symbol },
|
|
22
23
|
})));
|
|
24
|
+
register("toss_get_transactions", {
|
|
25
|
+
title: "Toss Get Transactions",
|
|
26
|
+
description: `Get account transactions: trades, cash and securities transfers, currency exchanges, dividends, interest and fees. KR/US stocks, options and bonds can appear; inspect assetClass. ${accountDescription} Dates use settlementDate in KST, not order or execution dates. Unsettled entries use their expected settlement date; omit the to filter to include future unsettled transactions. Results contain unsettled entries first, then settled entries, newest first within each group. Pass nextCursor unchanged and check hasNext even when fewer than limit entries are returned. Remove cursor when changing account or filters. No related order ID is provided.`,
|
|
27
|
+
inputSchema: {
|
|
28
|
+
...accountInputSchema(config),
|
|
29
|
+
transactionTypes: z
|
|
30
|
+
.array(z.enum([
|
|
31
|
+
"BUY",
|
|
32
|
+
"SELL",
|
|
33
|
+
"SECURITIES_TRANSFER_IN",
|
|
34
|
+
"SECURITIES_TRANSFER_OUT",
|
|
35
|
+
"DEPOSIT",
|
|
36
|
+
"WITHDRAWAL",
|
|
37
|
+
"EXCHANGE_IN",
|
|
38
|
+
"EXCHANGE_OUT",
|
|
39
|
+
"DIVIDEND",
|
|
40
|
+
"INTEREST",
|
|
41
|
+
"FEE",
|
|
42
|
+
]))
|
|
43
|
+
.optional()
|
|
44
|
+
.describe("OR filter. Omit or pass an empty array for all transaction types."),
|
|
45
|
+
from: dateSchema
|
|
46
|
+
.optional()
|
|
47
|
+
.describe("Inclusive settlement start date (KST)."),
|
|
48
|
+
to: dateSchema
|
|
49
|
+
.optional()
|
|
50
|
+
.describe("Inclusive settlement end date (KST), including future dates."),
|
|
51
|
+
cursor: z
|
|
52
|
+
.string()
|
|
53
|
+
.min(1)
|
|
54
|
+
.optional()
|
|
55
|
+
.describe("Opaque nextCursor from the previous response."),
|
|
56
|
+
limit: z
|
|
57
|
+
.number()
|
|
58
|
+
.int()
|
|
59
|
+
.min(1)
|
|
60
|
+
.max(100)
|
|
61
|
+
.optional()
|
|
62
|
+
.describe("Page size; defaults to 20, maximum 100."),
|
|
63
|
+
},
|
|
64
|
+
}, ({ accountSeq, transactionTypes, from, to, cursor, limit }) => runTool(() => {
|
|
65
|
+
if (from !== undefined && to !== undefined && from > to)
|
|
66
|
+
throw new Error("from must be on or before to (settlement dates in KST).");
|
|
67
|
+
return client.request({
|
|
68
|
+
path: "/api/v1/transactions",
|
|
69
|
+
accountSeq: resolveAccountSeq(accountSeq, config.defaultAccountSeq),
|
|
70
|
+
query: {
|
|
71
|
+
transactionTypes: transactionTypes?.join(","),
|
|
72
|
+
from,
|
|
73
|
+
to,
|
|
74
|
+
cursor,
|
|
75
|
+
limit,
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
}));
|
|
23
79
|
register("toss_get_buying_power", {
|
|
24
80
|
title: "Toss Get Buying Power",
|
|
25
81
|
description: "Get available buying power for an account. currency is required: KRW for Korean stocks, USD for US stocks.",
|
|
@@ -145,6 +145,16 @@ export function registerExtendedMarketTools(server, client) {
|
|
|
145
145
|
},
|
|
146
146
|
});
|
|
147
147
|
}));
|
|
148
|
+
register("toss_get_investor_trading_rankings", {
|
|
149
|
+
title: "투자자별 순매수·순매도 랭킹 조회",
|
|
150
|
+
description: "국내 주식·ETF의 외국인·기관·개인별 순매수·순매도 랭킹을 원화 거래액 기준으로 조회합니다. count는 각 투자자의 순매수·순매도 목록에 각각 적용되며 기본값과 최댓값은 100입니다. 최근 영업일 데이터만 제공하며 과거 날짜 조회는 지원하지 않습니다. 투자자별 기준 시각 rankedAt을 확인하세요. 개인 데이터는 정규장 종료 전에는 직전 영업일 기준일 수 있습니다. 시세는 포함하지 않으므로 필요하면 반환된 symbol로 toss_get_prices를 호출하세요.",
|
|
151
|
+
inputSchema: {
|
|
152
|
+
count: z.number().int().min(1).max(100).optional(),
|
|
153
|
+
},
|
|
154
|
+
}, ({ count }) => runTool(() => client.request({
|
|
155
|
+
path: "/api/v1/rankings/investor-trading",
|
|
156
|
+
query: { count },
|
|
157
|
+
})));
|
|
148
158
|
register("toss_get_market_indicator_prices", {
|
|
149
159
|
title: "시장 지표 현재가 조회",
|
|
150
160
|
description: "시장 지표 현재가 조회. 시장 지표(국내 지수·국채)의 현재가를 조회합니다. 최대 200건 까지 다건 조회를 지원하며 콤마(`,`)로 구분합니다.\n\n지원 심볼은 그룹 상단 **Market Indicators** 설명의 심볼 카탈로그(8종)를 따르며, 카탈로그에 없는 심볼은\n400 `unsupported-symbol` 로 응답합니다.\n\n**Rate Limits Group**: `MARKET_INDICATOR`\n",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tossinvest-mcp",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Model Context Protocol (MCP) server for Toss Securities Open API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@modelcontextprotocol/sdk": "^1.32.1",
|
|
44
44
|
"decimal.js": "^10.6.0",
|
|
45
45
|
"proper-lockfile": "^4.1.2",
|
|
46
|
-
"zod": "^4.
|
|
46
|
+
"zod": "^4.6.7"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@types/node": "^24.0.0",
|