datasinking 0.2.10__tar.gz → 0.2.11__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: datasinking
3
- Version: 0.2.10
3
+ Version: 0.2.11
4
4
  Summary: Python client for DataSinking — full-text Asian financial reports (China, Korea, Japan, Taiwan) as Markdown.
5
5
  Author: DataSinking
6
6
  License: MIT
@@ -102,7 +102,10 @@ Then use `command: datasinking-mcp` in your client.
102
102
  Both run the same six tools with the same schemas — `npm/` and `datasinking/mcp_server.py` are
103
103
  kept in lockstep by [`check_mcp_parity.py`](check_mcp_parity.py).
104
104
 
105
- Full per-client setup: [`mcp-server.md`](mcp-server.md).
105
+ Full per-client setup: [`mcp-server.md`](mcp-server.md) (overview) ·
106
+ [`docs/mcp/`](docs/mcp/) (one guide per client).
107
+ Hosted endpoint is **POST-only and stateless** — `GET /mcp` returns 405, no session id, and every
108
+ client needs a restart after a config change. That trips up most first connections.
106
109
 
107
110
  ![DataSinking MCP in Claude](docs/images/mcp-demo.png)
108
111
 
@@ -116,12 +119,26 @@ datasinking/
116
119
  ├── research/ # Research notes / blog posts (reproducing paper-style presentation)
117
120
  ├── datasinking/ # Python client + MCP server — pip install "datasinking[mcp]"
118
121
  ├── npm/ # The same MCP server on npm — npx -y datasinking-mcp (Node 18+)
119
- ├── mcp-server.md # How to configure the MCP server (for AI agents: Claude / Cursor / Codex / DeepSeek)
122
+ ├── docs/mcp/ # Per-client MCP setup: Claude Code, Claude Desktop, Cursor, Codex, WorkBuddy
123
+ ├── mcp-server.md # MCP server overview — the two config shapes, tools, endpoint limits
120
124
  ├── llm-examples.md # Ask an LLM — no code needed (8 end-to-end examples)
121
125
  ├── api-examples.md # 7 examples × 3 interfaces (curl / Python / LLM)
122
126
  └── README.md
123
127
  ```
124
128
 
129
+ Per-client MCP guides — one file each, with the exact config path, both scopes, verification and the
130
+ errors that client actually produces:
131
+
132
+ | Client | Guide |
133
+ |---|---|
134
+ | Claude Code | [`docs/mcp/claude-code.md`](docs/mcp/claude-code.md) |
135
+ | Claude Desktop | [`docs/mcp/claude-desktop.md`](docs/mcp/claude-desktop.md) |
136
+ | OpenAI Codex CLI | [`docs/mcp/codex.md`](docs/mcp/codex.md) |
137
+ | WorkBuddy / CodeBuddy | [`docs/mcp/workbuddy.md`](docs/mcp/workbuddy.md) |
138
+ | Cursor | [`docs/mcp/cursor.md`](docs/mcp/cursor.md) |
139
+ | DeepSeek | [`docs/mcp/deepseek.md`](docs/mcp/deepseek.md) |
140
+ | Windsurf | [`docs/mcp/windsurf.md`](docs/mcp/windsurf.md) |
141
+
125
142
  ## Quick start
126
143
 
127
144
  1. Get an API key at [datasink.ing](https://datasink.ing)
@@ -79,7 +79,10 @@ Then use `command: datasinking-mcp` in your client.
79
79
  Both run the same six tools with the same schemas — `npm/` and `datasinking/mcp_server.py` are
80
80
  kept in lockstep by [`check_mcp_parity.py`](check_mcp_parity.py).
81
81
 
82
- Full per-client setup: [`mcp-server.md`](mcp-server.md).
82
+ Full per-client setup: [`mcp-server.md`](mcp-server.md) (overview) ·
83
+ [`docs/mcp/`](docs/mcp/) (one guide per client).
84
+ Hosted endpoint is **POST-only and stateless** — `GET /mcp` returns 405, no session id, and every
85
+ client needs a restart after a config change. That trips up most first connections.
83
86
 
84
87
  ![DataSinking MCP in Claude](docs/images/mcp-demo.png)
85
88
 
@@ -93,12 +96,26 @@ datasinking/
93
96
  ├── research/ # Research notes / blog posts (reproducing paper-style presentation)
94
97
  ├── datasinking/ # Python client + MCP server — pip install "datasinking[mcp]"
95
98
  ├── npm/ # The same MCP server on npm — npx -y datasinking-mcp (Node 18+)
96
- ├── mcp-server.md # How to configure the MCP server (for AI agents: Claude / Cursor / Codex / DeepSeek)
99
+ ├── docs/mcp/ # Per-client MCP setup: Claude Code, Claude Desktop, Cursor, Codex, WorkBuddy
100
+ ├── mcp-server.md # MCP server overview — the two config shapes, tools, endpoint limits
97
101
  ├── llm-examples.md # Ask an LLM — no code needed (8 end-to-end examples)
98
102
  ├── api-examples.md # 7 examples × 3 interfaces (curl / Python / LLM)
99
103
  └── README.md
100
104
  ```
101
105
 
106
+ Per-client MCP guides — one file each, with the exact config path, both scopes, verification and the
107
+ errors that client actually produces:
108
+
109
+ | Client | Guide |
110
+ |---|---|
111
+ | Claude Code | [`docs/mcp/claude-code.md`](docs/mcp/claude-code.md) |
112
+ | Claude Desktop | [`docs/mcp/claude-desktop.md`](docs/mcp/claude-desktop.md) |
113
+ | OpenAI Codex CLI | [`docs/mcp/codex.md`](docs/mcp/codex.md) |
114
+ | WorkBuddy / CodeBuddy | [`docs/mcp/workbuddy.md`](docs/mcp/workbuddy.md) |
115
+ | Cursor | [`docs/mcp/cursor.md`](docs/mcp/cursor.md) |
116
+ | DeepSeek | [`docs/mcp/deepseek.md`](docs/mcp/deepseek.md) |
117
+ | Windsurf | [`docs/mcp/windsurf.md`](docs/mcp/windsurf.md) |
118
+
102
119
  ## Quick start
103
120
 
104
121
  1. Get an API key at [datasink.ing](https://datasink.ing)
@@ -8,4 +8,4 @@ pyproject.toml 用 `dynamic = ["version"]` 从这里读,`client.py` 的 User-A
8
8
  写着旧版本)。现在只有这一处需要改。
9
9
  """
10
10
 
11
- __version__ = "0.2.10"
11
+ __version__ = "0.2.11"
@@ -18,6 +18,7 @@ the environment variable ``DATASINK_API_KEY`` (get a free key at
18
18
  https://datasink.ing).
19
19
  """
20
20
 
21
+ import json
21
22
  import os
22
23
  from typing import Annotated, Optional
23
24
 
@@ -56,7 +57,18 @@ mcp = FastMCP(
56
57
 
57
58
 
58
59
  def _get(path: str, params: Optional[dict] = None) -> dict:
59
- """Call the DataSinking API, carrying the API key automatically."""
60
+ """Call the DataSinking API, carrying the API key automatically.
61
+
62
+ 出错时**把服务端 body 原文带出去**。它写的不是「失败了」,而是「该怎么办」:
63
+
64
+ ``detail`` 一句人话(「未找到章节「X」」)
65
+ ``available`` 那份报告的**全部真实标题**
66
+
67
+ ``get_section`` 的工具描述明确让模型「retry with one of those」,所以这个列表
68
+ 必须跟着异常走。原来这里是一句 ``r.raise_for_status()``,body 整个丢掉 ——
69
+ 模型只看到裸的 ``404 Client Error: Not Found for url: ...``,既不知道错在哪,
70
+ 也没有可重试的标题(2026-09-22 用真 key 实测,三份实现里这份丢得最干净)。
71
+ """
60
72
  if not API_KEY:
61
73
  raise RuntimeError(
62
74
  "Missing DATASINK_API_KEY environment variable (get a free key at https://datasink.ing)"
@@ -64,7 +76,18 @@ def _get(path: str, params: Optional[dict] = None) -> dict:
64
76
  p = dict(params or {})
65
77
  p["apikey"] = API_KEY
66
78
  r = requests.get(f"{BASE_URL}{path}", params=p, timeout=90)
67
- r.raise_for_status()
79
+ if not r.ok:
80
+ try:
81
+ body = r.json()
82
+ except ValueError:
83
+ body = None
84
+ if not isinstance(body, dict):
85
+ body = {}
86
+ msg = f"HTTP {r.status_code}: {body.get('detail') or r.text[:2000]}"
87
+ available = body.get("available")
88
+ if isinstance(available, list):
89
+ msg += "\nAvailable sections: " + json.dumps(available, ensure_ascii=False)
90
+ raise RuntimeError(msg)
68
91
  return r.json()
69
92
 
70
93
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: datasinking
3
- Version: 0.2.10
3
+ Version: 0.2.11
4
4
  Summary: Python client for DataSinking — full-text Asian financial reports (China, Korea, Japan, Taiwan) as Markdown.
5
5
  Author: DataSinking
6
6
  License: MIT
@@ -102,7 +102,10 @@ Then use `command: datasinking-mcp` in your client.
102
102
  Both run the same six tools with the same schemas — `npm/` and `datasinking/mcp_server.py` are
103
103
  kept in lockstep by [`check_mcp_parity.py`](check_mcp_parity.py).
104
104
 
105
- Full per-client setup: [`mcp-server.md`](mcp-server.md).
105
+ Full per-client setup: [`mcp-server.md`](mcp-server.md) (overview) ·
106
+ [`docs/mcp/`](docs/mcp/) (one guide per client).
107
+ Hosted endpoint is **POST-only and stateless** — `GET /mcp` returns 405, no session id, and every
108
+ client needs a restart after a config change. That trips up most first connections.
106
109
 
107
110
  ![DataSinking MCP in Claude](docs/images/mcp-demo.png)
108
111
 
@@ -116,12 +119,26 @@ datasinking/
116
119
  ├── research/ # Research notes / blog posts (reproducing paper-style presentation)
117
120
  ├── datasinking/ # Python client + MCP server — pip install "datasinking[mcp]"
118
121
  ├── npm/ # The same MCP server on npm — npx -y datasinking-mcp (Node 18+)
119
- ├── mcp-server.md # How to configure the MCP server (for AI agents: Claude / Cursor / Codex / DeepSeek)
122
+ ├── docs/mcp/ # Per-client MCP setup: Claude Code, Claude Desktop, Cursor, Codex, WorkBuddy
123
+ ├── mcp-server.md # MCP server overview — the two config shapes, tools, endpoint limits
120
124
  ├── llm-examples.md # Ask an LLM — no code needed (8 end-to-end examples)
121
125
  ├── api-examples.md # 7 examples × 3 interfaces (curl / Python / LLM)
122
126
  └── README.md
123
127
  ```
124
128
 
129
+ Per-client MCP guides — one file each, with the exact config path, both scopes, verification and the
130
+ errors that client actually produces:
131
+
132
+ | Client | Guide |
133
+ |---|---|
134
+ | Claude Code | [`docs/mcp/claude-code.md`](docs/mcp/claude-code.md) |
135
+ | Claude Desktop | [`docs/mcp/claude-desktop.md`](docs/mcp/claude-desktop.md) |
136
+ | OpenAI Codex CLI | [`docs/mcp/codex.md`](docs/mcp/codex.md) |
137
+ | WorkBuddy / CodeBuddy | [`docs/mcp/workbuddy.md`](docs/mcp/workbuddy.md) |
138
+ | Cursor | [`docs/mcp/cursor.md`](docs/mcp/cursor.md) |
139
+ | DeepSeek | [`docs/mcp/deepseek.md`](docs/mcp/deepseek.md) |
140
+ | Windsurf | [`docs/mcp/windsurf.md`](docs/mcp/windsurf.md) |
141
+
125
142
  ## Quick start
126
143
 
127
144
  1. Get an API key at [datasink.ing](https://datasink.ing)
File without changes
File without changes