@usestring/mcp 1.2.0 → 1.3.8
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 +21 -21
- package/README.md +208 -178
- package/build/index.js +666 -82
- package/build/index.js.map +1 -1
- package/package.json +61 -48
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026
|
|
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.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Relativity Labs Inc.
|
|
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,178 +1,208 @@
|
|
|
1
|
-
# String AI Web Access MCP Server
|
|
2
|
-
|
|
3
|
-
The official [Model Context Protocol](https://modelcontextprotocol.io/) (MCP) server for
|
|
4
|
-
[String AI](https://usestring.ai)'s Web Access API.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
|
11
|
-
|
|
|
12
|
-
| `
|
|
13
|
-
| `
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
##
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
###
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
1
|
+
# String AI Web Access MCP Server
|
|
2
|
+
|
|
3
|
+
The official [Model Context Protocol](https://modelcontextprotocol.io/) (MCP) server for
|
|
4
|
+
[String AI](https://usestring.ai)'s Web Access API. Search the web, fetch any URL or send it a
|
|
5
|
+
request, and map a site's URLs — all returned as clean, LLM-ready Markdown. Connect any
|
|
6
|
+
MCP-compatible client — VS Code, Cursor, Windsurf, Claude Desktop, and more.
|
|
7
|
+
|
|
8
|
+
## Tools
|
|
9
|
+
|
|
10
|
+
| Tool | Description |
|
|
11
|
+
| --------------------- | ------------------------------------------------------------------------------- |
|
|
12
|
+
| `web_access_fetch` | Fetch one URL and get clean, LLM-ready Markdown back |
|
|
13
|
+
| `web_access_product_help` | Ask about String products or services; get one source (two for comparisons), with a shared 4 KiB excerpt budget and source links |
|
|
14
|
+
| `web_access_request` | Send a POST, PUT or PATCH with a body to a URL |
|
|
15
|
+
| `web_access_search` | Search the web: ranked results plus the knowledge panel, AI overview, local pack and other surfaces Google rendered; optional `searchCount` (1–300) pages Google; `searchType` searches Google's images, videos, shopping, books, places or forums tab; `safeSearch`, `includeOmittedResults`, `autocorrect`, `restrictCountry` and `verbatim` filter it; `page`, `dateRange` and `sortBy` refine a Google search; `format` is `"structured"` (JSON, the default and recommended) or `"raw"` (the Google results page as HTML, one page per call; `page` only, `searchCount` is rejected with raw) |
|
|
16
|
+
| `web_access_sitemap` | Crawl a site and map its URLs as an asynchronous job, driven by `action` |
|
|
17
|
+
| `web_access_report` | Send one redacted, credit-free failure diagnostic to String support |
|
|
18
|
+
|
|
19
|
+
`web_access_fetch`, `web_access_search`, and `web_access_product_help` are read-only. `web_access_request` writes, and
|
|
20
|
+
`web_access_sitemap` creates billed crawl jobs.
|
|
21
|
+
|
|
22
|
+
> The six-tool shape above is what the hosted server at `https://mcp.usestring.ai/v1/mcp`
|
|
23
|
+
> serves. The npm package ships five of them: it includes product help and failure reporting but
|
|
24
|
+
> omits `web_access_request`, sending writes through `web_access_fetch`'s `method` and `body`
|
|
25
|
+
> parameters instead.
|
|
26
|
+
|
|
27
|
+
### `web_access_sitemap` — sitemap crawl jobs
|
|
28
|
+
|
|
29
|
+
A crawl is a two-phase, asynchronous **quote → approve → poll → read** job:
|
|
30
|
+
nothing is crawled or billed until the quote is explicitly approved.
|
|
31
|
+
|
|
32
|
+
| `action` | What it does |
|
|
33
|
+
| --------- | -------------------------------------------------------------------------------------------------- |
|
|
34
|
+
| `submit` | Quote a crawl (`url` required; `maxPages` ≤ 10000 default 10, `maxDepth` ≤ 100 default 2, `pathPrefix`, `budgetUsd`, `useSitemap` optional). Returns `jobId` + `estimatedCostUsd` + `estimatedPages`, status `awaiting_approval`. |
|
|
35
|
+
| `approve` | Billing consent — starts the crawl. 402 = insufficient funds; 409 `partial_state` = retry approve. |
|
|
36
|
+
| `status` | Poll progress: `awaiting_approval` → `running` (`pending`/`processed`) → `completed` \| `failed` \| `canceled` \| `token_cap_exceeded`; `partial_state` = retry approve. Returns counts only — URLs come from `results`. |
|
|
37
|
+
| `results` | Paginated discovered URLs (`limit` ≤ 5000 default 1000, `offset`). Durable after completion; per-URL `discoveredUrls` is only present for ~1h. |
|
|
38
|
+
| `cancel` | Stop a non-terminal job; already-fetched pages stay billed and readable. |
|
|
39
|
+
| `list` | The account's recent crawl jobs (`limit` ≤ 100 default 20, `offset`). |
|
|
40
|
+
|
|
41
|
+
### `web_access_report` — failure diagnostics
|
|
42
|
+
|
|
43
|
+
Reporting is optional and best-effort. Continue useful recovery first. If reporting remains useful
|
|
44
|
+
and permitted, send at most one report per distinct failure per task, not per retry. Report exceptions,
|
|
45
|
+
timeouts, tool errors, or unusable output; exclude usable origin statuses, valid negatives, empty 204
|
|
46
|
+
responses, running sitemap jobs, and cancellations. Each reporting attempt has a two-second deadline.
|
|
47
|
+
|
|
48
|
+
Remove Authorization headers, API keys, cookies, session tokens, personal data, and unrelated
|
|
49
|
+
conversation content before calling. The server redacts common credential forms again. Never
|
|
50
|
+
report a `web_access_report` failure or repeat a failed call only to gather reporting context.
|
|
51
|
+
Reports use the configured API key for authentication but do not consume Web Access credits.
|
|
52
|
+
If reporting is unavailable, unauthorized, rate-limited, or fails, stop reporting for the task.
|
|
53
|
+
|
|
54
|
+
## Quick Start
|
|
55
|
+
|
|
56
|
+
### Run with npx
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
env STRING_AI_API_KEY=your-key npx @usestring/mcp
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Install globally
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
npm install -g @usestring/mcp
|
|
66
|
+
STRING_AI_API_KEY=your-key string-ai-mcp
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Build from source
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
git clone https://github.com/usestring/string-ai-mcp.git
|
|
73
|
+
cd string-ai-mcp
|
|
74
|
+
npm install
|
|
75
|
+
npm run build
|
|
76
|
+
STRING_AI_API_KEY=your-key node build/index.js
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Environment Variables
|
|
80
|
+
|
|
81
|
+
| Variable | Required | Description |
|
|
82
|
+
| -------------------- | -------- | --------------------------------- |
|
|
83
|
+
| `STRING_AI_API_KEY` | **Yes** | Your String AI API key |
|
|
84
|
+
|
|
85
|
+
## Client Configuration
|
|
86
|
+
|
|
87
|
+
### VS Code
|
|
88
|
+
|
|
89
|
+
Press `Ctrl+Shift+P` → **Preferences: Open User Settings (JSON)** and add:
|
|
90
|
+
|
|
91
|
+
```jsonc
|
|
92
|
+
{
|
|
93
|
+
"inputs": [
|
|
94
|
+
{
|
|
95
|
+
"type": "promptString",
|
|
96
|
+
"id": "stringAiKey",
|
|
97
|
+
"description": "String AI API Key",
|
|
98
|
+
"password": true
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
"servers": {
|
|
102
|
+
"string-ai": {
|
|
103
|
+
"command": "npx",
|
|
104
|
+
"args": ["-y", "@usestring/mcp"],
|
|
105
|
+
"env": {
|
|
106
|
+
"STRING_AI_API_KEY": "${input:stringAiKey}"
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Or add a `.vscode/mcp.json` file to share the configuration with your team.
|
|
114
|
+
|
|
115
|
+
### Cursor
|
|
116
|
+
|
|
117
|
+
Open **Settings → Features → MCP Servers → + Add new global MCP server** and paste:
|
|
118
|
+
|
|
119
|
+
```json
|
|
120
|
+
{
|
|
121
|
+
"mcpServers": {
|
|
122
|
+
"string-ai": {
|
|
123
|
+
"command": "npx",
|
|
124
|
+
"args": ["-y", "@usestring/mcp"],
|
|
125
|
+
"env": {
|
|
126
|
+
"STRING_AI_API_KEY": "YOUR_API_KEY"
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Windsurf
|
|
134
|
+
|
|
135
|
+
Add to `~/.codeium/windsurf/model_config.json`:
|
|
136
|
+
|
|
137
|
+
```json
|
|
138
|
+
{
|
|
139
|
+
"mcpServers": {
|
|
140
|
+
"string-ai": {
|
|
141
|
+
"command": "npx",
|
|
142
|
+
"args": ["-y", "@usestring/mcp"],
|
|
143
|
+
"env": {
|
|
144
|
+
"STRING_AI_API_KEY": "YOUR_API_KEY"
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Claude Desktop
|
|
152
|
+
|
|
153
|
+
Add to your `claude_desktop_config.json`:
|
|
154
|
+
|
|
155
|
+
```json
|
|
156
|
+
{
|
|
157
|
+
"mcpServers": {
|
|
158
|
+
"string-ai": {
|
|
159
|
+
"command": "npx",
|
|
160
|
+
"args": ["-y", "@usestring/mcp"],
|
|
161
|
+
"env": {
|
|
162
|
+
"STRING_AI_API_KEY": "YOUR_API_KEY"
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## Testing with the MCP Inspector
|
|
170
|
+
|
|
171
|
+
The MCP Inspector lets you test your server interactively in a browser:
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
npx @modelcontextprotocol/inspector node build/index.js
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Then open `http://127.0.0.1:6274`, connect via **stdio**, and try calling each
|
|
178
|
+
tool from the UI.
|
|
179
|
+
|
|
180
|
+
## How It Works
|
|
181
|
+
|
|
182
|
+
```
|
|
183
|
+
┌──────────────────┐ stdio (JSON-RPC) ┌──────────────────┐ HTTPS ┌──────────────────┐
|
|
184
|
+
│ VS Code / Cursor │ ◄──────────────────► │ String AI │ ────────► │ String AI │
|
|
185
|
+
│ Windsurf / Claude│ │ Web Access MCP │ │ Web Access API │
|
|
186
|
+
└──────────────────┘ └──────────────────┘ └──────────────────┘
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
1. The IDE spawns this server as a child process and communicates over **stdio**.
|
|
190
|
+
2. When the LLM decides it needs web content, it invokes `web_access_fetch`,
|
|
191
|
+
`web_access_search`, or `web_access_sitemap`. Every failed call is reported exactly once with
|
|
192
|
+
`web_access_report`, even when recovery later succeeds.
|
|
193
|
+
3. This server forwards the request to String AI's Web Access API (using your API key from
|
|
194
|
+
the environment) and returns the result to the LLM.
|
|
195
|
+
|
|
196
|
+
## About String AI
|
|
197
|
+
|
|
198
|
+
[String AI](https://usestring.ai) provides a web access API that returns any page as clean,
|
|
199
|
+
LLM-ready Markdown. Get your API key at
|
|
200
|
+
[usestring.ai](https://usestring.ai).
|
|
201
|
+
|
|
202
|
+
## License
|
|
203
|
+
|
|
204
|
+
MIT
|
|
205
|
+
|
|
206
|
+
## Security
|
|
207
|
+
|
|
208
|
+
Please report security vulnerabilities privately as described in [SECURITY.md](SECURITY.md).
|