profound-mcp 0.14.0 → 0.17.0

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.
Files changed (272) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +14 -184
  3. package/code-tool-types.d.mts +6 -9
  4. package/code-tool-types.d.mts.map +1 -1
  5. package/code-tool-types.d.ts +6 -9
  6. package/code-tool-types.d.ts.map +1 -1
  7. package/code-tool.d.mts +2 -2
  8. package/code-tool.d.mts.map +1 -1
  9. package/code-tool.d.ts +2 -2
  10. package/code-tool.d.ts.map +1 -1
  11. package/code-tool.js +53 -145
  12. package/code-tool.js.map +1 -1
  13. package/code-tool.mjs +53 -112
  14. package/code-tool.mjs.map +1 -1
  15. package/docs-search-tool.d.mts +15 -9
  16. package/docs-search-tool.d.mts.map +1 -1
  17. package/docs-search-tool.d.ts +15 -9
  18. package/docs-search-tool.d.ts.map +1 -1
  19. package/docs-search-tool.js +4 -1
  20. package/docs-search-tool.js.map +1 -1
  21. package/docs-search-tool.mjs +4 -1
  22. package/docs-search-tool.mjs.map +1 -1
  23. package/http.d.mts.map +1 -1
  24. package/http.d.ts.map +1 -1
  25. package/http.js +1 -18
  26. package/http.js.map +1 -1
  27. package/http.mjs +1 -18
  28. package/http.mjs.map +1 -1
  29. package/index.js +4 -40
  30. package/index.js.map +1 -1
  31. package/index.mjs +4 -40
  32. package/index.mjs.map +1 -1
  33. package/options.d.mts +0 -9
  34. package/options.d.mts.map +1 -1
  35. package/options.d.ts +0 -9
  36. package/options.d.ts.map +1 -1
  37. package/options.js +6 -361
  38. package/options.js.map +1 -1
  39. package/options.mjs +6 -361
  40. package/options.mjs.map +1 -1
  41. package/package.json +10 -66
  42. package/server.d.mts +3 -8
  43. package/server.d.mts.map +1 -1
  44. package/server.d.ts +3 -8
  45. package/server.d.ts.map +1 -1
  46. package/server.js +12 -65
  47. package/server.js.map +1 -1
  48. package/server.mjs +11 -62
  49. package/server.mjs.map +1 -1
  50. package/src/code-tool-types.ts +6 -9
  51. package/src/code-tool.ts +60 -138
  52. package/src/docs-search-tool.ts +8 -1
  53. package/src/http.ts +1 -19
  54. package/src/index.ts +5 -52
  55. package/src/options.ts +7 -388
  56. package/src/server.ts +12 -72
  57. package/src/stdio.ts +2 -3
  58. package/src/{tools/types.ts → types.ts} +1 -1
  59. package/stdio.d.mts +1 -2
  60. package/stdio.d.mts.map +1 -1
  61. package/stdio.d.ts +1 -2
  62. package/stdio.d.ts.map +1 -1
  63. package/stdio.js +2 -2
  64. package/stdio.js.map +1 -1
  65. package/stdio.mjs +2 -2
  66. package/stdio.mjs.map +1 -1
  67. package/{tools/types.d.mts → types.d.mts} +1 -1
  68. package/types.d.mts.map +1 -0
  69. package/{tools/types.d.ts → types.d.ts} +1 -1
  70. package/types.d.ts.map +1 -0
  71. package/types.js.map +1 -0
  72. package/types.mjs.map +1 -0
  73. package/code-tool-paths.cjs +0 -6
  74. package/code-tool-paths.cjs.map +0 -1
  75. package/code-tool-paths.d.cts +0 -2
  76. package/code-tool-paths.d.cts.map +0 -1
  77. package/code-tool-worker.d.mts +0 -5
  78. package/code-tool-worker.d.mts.map +0 -1
  79. package/code-tool-worker.d.ts +0 -5
  80. package/code-tool-worker.d.ts.map +0 -1
  81. package/code-tool-worker.js +0 -169
  82. package/code-tool-worker.js.map +0 -1
  83. package/code-tool-worker.mjs +0 -164
  84. package/code-tool-worker.mjs.map +0 -1
  85. package/compat.d.mts +0 -58
  86. package/compat.d.mts.map +0 -1
  87. package/compat.d.ts +0 -58
  88. package/compat.d.ts.map +0 -1
  89. package/compat.js +0 -387
  90. package/compat.js.map +0 -1
  91. package/compat.mjs +0 -378
  92. package/compat.mjs.map +0 -1
  93. package/dynamic-tools.d.mts +0 -12
  94. package/dynamic-tools.d.mts.map +0 -1
  95. package/dynamic-tools.d.ts +0 -12
  96. package/dynamic-tools.d.ts.map +0 -1
  97. package/dynamic-tools.js +0 -135
  98. package/dynamic-tools.js.map +0 -1
  99. package/dynamic-tools.mjs +0 -132
  100. package/dynamic-tools.mjs.map +0 -1
  101. package/filtering.d.mts +0 -3
  102. package/filtering.d.mts.map +0 -1
  103. package/filtering.d.ts +0 -3
  104. package/filtering.d.ts.map +0 -1
  105. package/filtering.js +0 -24
  106. package/filtering.js.map +0 -1
  107. package/filtering.mjs +0 -16
  108. package/filtering.mjs.map +0 -1
  109. package/src/code-tool-paths.cts +0 -3
  110. package/src/code-tool-worker.ts +0 -215
  111. package/src/compat.ts +0 -483
  112. package/src/dynamic-tools.ts +0 -153
  113. package/src/filtering.ts +0 -18
  114. package/src/tools/index.ts +0 -99
  115. package/src/tools/logs/raw/bots-logs-raw.ts +0 -544
  116. package/src/tools/logs/raw/logs-logs-raw.ts +0 -565
  117. package/src/tools/organizations/categories/assets-organizations-categories.ts +0 -57
  118. package/src/tools/organizations/categories/list-organizations-categories.ts +0 -51
  119. package/src/tools/organizations/categories/prompts-organizations-categories.ts +0 -57
  120. package/src/tools/organizations/categories/tags-organizations-categories.ts +0 -57
  121. package/src/tools/organizations/categories/topics-organizations-categories.ts +0 -57
  122. package/src/tools/organizations/domains-organizations.ts +0 -51
  123. package/src/tools/organizations/list-assets-organizations.ts +0 -51
  124. package/src/tools/organizations/models-organizations.ts +0 -51
  125. package/src/tools/organizations/regions-organizations.ts +0 -51
  126. package/src/tools/prompts/answers-prompts.ts +0 -370
  127. package/src/tools/reports/citations-reports.ts +0 -504
  128. package/src/tools/reports/sentiment-reports.ts +0 -418
  129. package/src/tools/reports/visibility-reports.ts +0 -364
  130. package/src/tools.ts +0 -1
  131. package/tools/index.d.mts +0 -10
  132. package/tools/index.d.mts.map +0 -1
  133. package/tools/index.d.ts +0 -10
  134. package/tools/index.d.ts.map +0 -1
  135. package/tools/index.js +0 -83
  136. package/tools/index.js.map +0 -1
  137. package/tools/index.mjs +0 -76
  138. package/tools/index.mjs.map +0 -1
  139. package/tools/logs/raw/bots-logs-raw.d.mts +0 -45
  140. package/tools/logs/raw/bots-logs-raw.d.mts.map +0 -1
  141. package/tools/logs/raw/bots-logs-raw.d.ts +0 -45
  142. package/tools/logs/raw/bots-logs-raw.d.ts.map +0 -1
  143. package/tools/logs/raw/bots-logs-raw.js +0 -544
  144. package/tools/logs/raw/bots-logs-raw.js.map +0 -1
  145. package/tools/logs/raw/bots-logs-raw.mjs +0 -537
  146. package/tools/logs/raw/bots-logs-raw.mjs.map +0 -1
  147. package/tools/logs/raw/logs-logs-raw.d.mts +0 -45
  148. package/tools/logs/raw/logs-logs-raw.d.mts.map +0 -1
  149. package/tools/logs/raw/logs-logs-raw.d.ts +0 -45
  150. package/tools/logs/raw/logs-logs-raw.d.ts.map +0 -1
  151. package/tools/logs/raw/logs-logs-raw.js +0 -565
  152. package/tools/logs/raw/logs-logs-raw.js.map +0 -1
  153. package/tools/logs/raw/logs-logs-raw.mjs +0 -558
  154. package/tools/logs/raw/logs-logs-raw.mjs.map +0 -1
  155. package/tools/organizations/categories/assets-organizations-categories.d.mts +0 -45
  156. package/tools/organizations/categories/assets-organizations-categories.d.mts.map +0 -1
  157. package/tools/organizations/categories/assets-organizations-categories.d.ts +0 -45
  158. package/tools/organizations/categories/assets-organizations-categories.d.ts.map +0 -1
  159. package/tools/organizations/categories/assets-organizations-categories.js +0 -55
  160. package/tools/organizations/categories/assets-organizations-categories.js.map +0 -1
  161. package/tools/organizations/categories/assets-organizations-categories.mjs +0 -48
  162. package/tools/organizations/categories/assets-organizations-categories.mjs.map +0 -1
  163. package/tools/organizations/categories/list-organizations-categories.d.mts +0 -45
  164. package/tools/organizations/categories/list-organizations-categories.d.mts.map +0 -1
  165. package/tools/organizations/categories/list-organizations-categories.d.ts +0 -45
  166. package/tools/organizations/categories/list-organizations-categories.d.ts.map +0 -1
  167. package/tools/organizations/categories/list-organizations-categories.js +0 -51
  168. package/tools/organizations/categories/list-organizations-categories.js.map +0 -1
  169. package/tools/organizations/categories/list-organizations-categories.mjs +0 -44
  170. package/tools/organizations/categories/list-organizations-categories.mjs.map +0 -1
  171. package/tools/organizations/categories/prompts-organizations-categories.d.mts +0 -45
  172. package/tools/organizations/categories/prompts-organizations-categories.d.mts.map +0 -1
  173. package/tools/organizations/categories/prompts-organizations-categories.d.ts +0 -45
  174. package/tools/organizations/categories/prompts-organizations-categories.d.ts.map +0 -1
  175. package/tools/organizations/categories/prompts-organizations-categories.js +0 -55
  176. package/tools/organizations/categories/prompts-organizations-categories.js.map +0 -1
  177. package/tools/organizations/categories/prompts-organizations-categories.mjs +0 -48
  178. package/tools/organizations/categories/prompts-organizations-categories.mjs.map +0 -1
  179. package/tools/organizations/categories/tags-organizations-categories.d.mts +0 -45
  180. package/tools/organizations/categories/tags-organizations-categories.d.mts.map +0 -1
  181. package/tools/organizations/categories/tags-organizations-categories.d.ts +0 -45
  182. package/tools/organizations/categories/tags-organizations-categories.d.ts.map +0 -1
  183. package/tools/organizations/categories/tags-organizations-categories.js +0 -55
  184. package/tools/organizations/categories/tags-organizations-categories.js.map +0 -1
  185. package/tools/organizations/categories/tags-organizations-categories.mjs +0 -48
  186. package/tools/organizations/categories/tags-organizations-categories.mjs.map +0 -1
  187. package/tools/organizations/categories/topics-organizations-categories.d.mts +0 -45
  188. package/tools/organizations/categories/topics-organizations-categories.d.mts.map +0 -1
  189. package/tools/organizations/categories/topics-organizations-categories.d.ts +0 -45
  190. package/tools/organizations/categories/topics-organizations-categories.d.ts.map +0 -1
  191. package/tools/organizations/categories/topics-organizations-categories.js +0 -55
  192. package/tools/organizations/categories/topics-organizations-categories.js.map +0 -1
  193. package/tools/organizations/categories/topics-organizations-categories.mjs +0 -48
  194. package/tools/organizations/categories/topics-organizations-categories.mjs.map +0 -1
  195. package/tools/organizations/domains-organizations.d.mts +0 -45
  196. package/tools/organizations/domains-organizations.d.mts.map +0 -1
  197. package/tools/organizations/domains-organizations.d.ts +0 -45
  198. package/tools/organizations/domains-organizations.d.ts.map +0 -1
  199. package/tools/organizations/domains-organizations.js +0 -51
  200. package/tools/organizations/domains-organizations.js.map +0 -1
  201. package/tools/organizations/domains-organizations.mjs +0 -44
  202. package/tools/organizations/domains-organizations.mjs.map +0 -1
  203. package/tools/organizations/list-assets-organizations.d.mts +0 -45
  204. package/tools/organizations/list-assets-organizations.d.mts.map +0 -1
  205. package/tools/organizations/list-assets-organizations.d.ts +0 -45
  206. package/tools/organizations/list-assets-organizations.d.ts.map +0 -1
  207. package/tools/organizations/list-assets-organizations.js +0 -51
  208. package/tools/organizations/list-assets-organizations.js.map +0 -1
  209. package/tools/organizations/list-assets-organizations.mjs +0 -44
  210. package/tools/organizations/list-assets-organizations.mjs.map +0 -1
  211. package/tools/organizations/models-organizations.d.mts +0 -45
  212. package/tools/organizations/models-organizations.d.mts.map +0 -1
  213. package/tools/organizations/models-organizations.d.ts +0 -45
  214. package/tools/organizations/models-organizations.d.ts.map +0 -1
  215. package/tools/organizations/models-organizations.js +0 -51
  216. package/tools/organizations/models-organizations.js.map +0 -1
  217. package/tools/organizations/models-organizations.mjs +0 -44
  218. package/tools/organizations/models-organizations.mjs.map +0 -1
  219. package/tools/organizations/regions-organizations.d.mts +0 -45
  220. package/tools/organizations/regions-organizations.d.mts.map +0 -1
  221. package/tools/organizations/regions-organizations.d.ts +0 -45
  222. package/tools/organizations/regions-organizations.d.ts.map +0 -1
  223. package/tools/organizations/regions-organizations.js +0 -51
  224. package/tools/organizations/regions-organizations.js.map +0 -1
  225. package/tools/organizations/regions-organizations.mjs +0 -44
  226. package/tools/organizations/regions-organizations.mjs.map +0 -1
  227. package/tools/prompts/answers-prompts.d.mts +0 -45
  228. package/tools/prompts/answers-prompts.d.mts.map +0 -1
  229. package/tools/prompts/answers-prompts.d.ts +0 -45
  230. package/tools/prompts/answers-prompts.d.ts.map +0 -1
  231. package/tools/prompts/answers-prompts.js +0 -372
  232. package/tools/prompts/answers-prompts.js.map +0 -1
  233. package/tools/prompts/answers-prompts.mjs +0 -365
  234. package/tools/prompts/answers-prompts.mjs.map +0 -1
  235. package/tools/reports/citations-reports.d.mts +0 -45
  236. package/tools/reports/citations-reports.d.mts.map +0 -1
  237. package/tools/reports/citations-reports.d.ts +0 -45
  238. package/tools/reports/citations-reports.d.ts.map +0 -1
  239. package/tools/reports/citations-reports.js +0 -503
  240. package/tools/reports/citations-reports.js.map +0 -1
  241. package/tools/reports/citations-reports.mjs +0 -496
  242. package/tools/reports/citations-reports.mjs.map +0 -1
  243. package/tools/reports/sentiment-reports.d.mts +0 -45
  244. package/tools/reports/sentiment-reports.d.mts.map +0 -1
  245. package/tools/reports/sentiment-reports.d.ts +0 -45
  246. package/tools/reports/sentiment-reports.d.ts.map +0 -1
  247. package/tools/reports/sentiment-reports.js +0 -417
  248. package/tools/reports/sentiment-reports.js.map +0 -1
  249. package/tools/reports/sentiment-reports.mjs +0 -410
  250. package/tools/reports/sentiment-reports.mjs.map +0 -1
  251. package/tools/reports/visibility-reports.d.mts +0 -45
  252. package/tools/reports/visibility-reports.d.mts.map +0 -1
  253. package/tools/reports/visibility-reports.d.ts +0 -45
  254. package/tools/reports/visibility-reports.d.ts.map +0 -1
  255. package/tools/reports/visibility-reports.js +0 -363
  256. package/tools/reports/visibility-reports.js.map +0 -1
  257. package/tools/reports/visibility-reports.mjs +0 -356
  258. package/tools/reports/visibility-reports.mjs.map +0 -1
  259. package/tools/types.d.mts.map +0 -1
  260. package/tools/types.d.ts.map +0 -1
  261. package/tools/types.js.map +0 -1
  262. package/tools/types.mjs.map +0 -1
  263. package/tools.d.mts +0 -2
  264. package/tools.d.mts.map +0 -1
  265. package/tools.d.ts +0 -2
  266. package/tools.d.ts.map +0 -1
  267. package/tools.js +0 -18
  268. package/tools.js.map +0 -1
  269. package/tools.mjs +0 -2
  270. package/tools.mjs.map +0 -1
  271. /package/{tools/types.js → types.js} +0 -0
  272. /package/{tools/types.mjs → types.mjs} +0 -0
package/LICENSE CHANGED
@@ -186,7 +186,7 @@
186
186
  same "printed page" as the copyright notice for easier
187
187
  identification within third-party archives.
188
188
 
189
- Copyright 2025 Profound
189
+ Copyright 2026 Profound
190
190
 
191
191
  Licensed under the Apache License, Version 2.0 (the "License");
192
192
  you may not use this file except in compliance with the License.
package/README.md CHANGED
@@ -25,7 +25,7 @@ For clients with a configuration JSON, it might look something like this:
25
25
  "mcpServers": {
26
26
  "profoundai_api": {
27
27
  "command": "npx",
28
- "args": ["-y", "profound-mcp", "--client=claude", "--tools=all"],
28
+ "args": ["-y", "profound-mcp"],
29
29
  "env": {
30
30
  "PROFOUND_API_KEY": "My API Key"
31
31
  }
@@ -54,113 +54,25 @@ If you use Claude Code, you can install the MCP server by running the command be
54
54
  environment variables in Claude Code's `.claude.json`, which can be found in your home directory.
55
55
 
56
56
  ```
57
- claude mcp add --transport stdio profoundai_api --env PROFOUND_API_KEY="Your PROFOUND_API_KEY here." -- npx -y profound-mcp
57
+ claude mcp add profound_mcp_api --env PROFOUND_API_KEY="Your PROFOUND_API_KEY here." -- npx -y profound-mcp
58
58
  ```
59
59
 
60
- ## Exposing endpoints to your MCP Client
60
+ ## Code Mode
61
61
 
62
- There are three ways to expose endpoints as tools in the MCP server:
62
+ This MCP server is built on the "Code Mode" tool scheme. In this MCP Server,
63
+ your agent will write code against the TypeScript SDK, which will then be executed in an
64
+ isolated sandbox. To accomplish this, the server will expose two tools to your agent:
63
65
 
64
- 1. Exposing one tool per endpoint, and filtering as necessary
65
- 2. Exposing a set of tools to dynamically discover and invoke endpoints from the API
66
- 3. Exposing a docs search tool and a code execution tool, allowing the client to write code to be executed against the TypeScript client
66
+ - The first tool is a docs search tool, which can be used to generically query for
67
+ documentation about your API/SDK.
67
68
 
68
- ### Filtering endpoints and tools
69
+ - The second tool is a code tool, where the agent can write code against the TypeScript SDK.
70
+ The code will be executed in a sandbox environment without web or filesystem access. Then,
71
+ anything the code returns or prints will be returned to the agent as the result of the
72
+ tool call.
69
73
 
70
- You can run the package on the command line to discover and filter the set of tools that are exposed by the
71
- MCP Server. This can be helpful for large APIs where including all endpoints at once is too much for your AI's
72
- context window.
73
-
74
- You can filter by multiple aspects:
75
-
76
- - `--tool` includes a specific tool by name
77
- - `--resource` includes all tools under a specific resource, and can have wildcards, e.g. `my.resource*`
78
- - `--operation` includes just read (get/list) or just write operations
79
-
80
- ### Dynamic tools
81
-
82
- If you specify `--tools=dynamic` to the MCP server, instead of exposing one tool per endpoint in the API, it will
83
- expose the following tools:
84
-
85
- 1. `list_api_endpoints` - Discovers available endpoints, with optional filtering by search query
86
- 2. `get_api_endpoint_schema` - Gets detailed schema information for a specific endpoint
87
- 3. `invoke_api_endpoint` - Executes any endpoint with the appropriate parameters
88
-
89
- This allows you to have the full set of API endpoints available to your MCP Client, while not requiring that all
90
- of their schemas be loaded into context at once. Instead, the LLM will automatically use these tools together to
91
- search for, look up, and invoke endpoints dynamically. However, due to the indirect nature of the schemas, it
92
- can struggle to provide the correct properties a bit more than when tools are imported explicitly. Therefore,
93
- you can opt-in to explicit tools, the dynamic tools, or both.
94
-
95
- See more information with `--help`.
96
-
97
- All of these command-line options can be repeated, combined together, and have corresponding exclusion versions (e.g. `--no-tool`).
98
-
99
- Use `--list` to see the list of available tools, or see below.
100
-
101
- ### Code execution
102
-
103
- If you specify `--tools=code` to the MCP server, it will expose just two tools:
104
-
105
- - `search_docs` - Searches the API documentation and returns a list of markdown results
106
- - `execute` - Runs code against the TypeScript client
107
-
108
- This allows the LLM to implement more complex logic by chaining together many API calls without loading
109
- intermediary results into its context window.
110
-
111
- The code execution itself happens in a Deno sandbox that has network access only to the base URL for the API.
112
-
113
- ### Specifying the MCP Client
114
-
115
- Different clients have varying abilities to handle arbitrary tools and schemas.
116
-
117
- You can specify the client you are using with the `--client` argument, and the MCP server will automatically
118
- serve tools and schemas that are more compatible with that client.
119
-
120
- - `--client=<type>`: Set all capabilities based on a known MCP client
121
-
122
- - Valid values: `openai-agents`, `claude`, `claude-code`, `cursor`
123
- - Example: `--client=cursor`
124
-
125
- Additionally, if you have a client not on the above list, or the client has gotten better
126
- over time, you can manually enable or disable certain capabilities:
127
-
128
- - `--capability=<name>`: Specify individual client capabilities
129
- - Available capabilities:
130
- - `top-level-unions`: Enable support for top-level unions in tool schemas
131
- - `valid-json`: Enable JSON string parsing for arguments
132
- - `refs`: Enable support for $ref pointers in schemas
133
- - `unions`: Enable support for union types (anyOf) in schemas
134
- - `formats`: Enable support for format validations in schemas (e.g. date-time, email)
135
- - `tool-name-length=N`: Set maximum tool name length to N characters
136
- - Example: `--capability=top-level-unions --capability=tool-name-length=40`
137
- - Example: `--capability=top-level-unions,tool-name-length=40`
138
-
139
- ### Examples
140
-
141
- 1. Filter for read operations on cards:
142
-
143
- ```bash
144
- --resource=cards --operation=read
145
- ```
146
-
147
- 2. Exclude specific tools while including others:
148
-
149
- ```bash
150
- --resource=cards --no-tool=create_cards
151
- ```
152
-
153
- 3. Configure for Cursor client with custom max tool name length:
154
-
155
- ```bash
156
- --client=cursor --capability=tool-name-length=40
157
- ```
158
-
159
- 4. Complex filtering with multiple criteria:
160
-
161
- ```bash
162
- --resource=cards,accounts --operation=read --tag=kyc --no-tool=create_cards
163
- ```
74
+ Using this scheme, agents are capable of performing very complex tasks deterministically
75
+ and repeatably.
164
76
 
165
77
  ## Running remotely
166
78
 
@@ -185,85 +97,3 @@ A configuration JSON for this server might look like this, assuming the server i
185
97
  }
186
98
  }
187
99
  ```
188
-
189
- The command-line arguments for filtering tools and specifying clients can also be used as query parameters in the URL.
190
- For example, to exclude specific tools while including others, use the URL:
191
-
192
- ```
193
- http://localhost:3000?resource=cards&resource=accounts&no_tool=create_cards
194
- ```
195
-
196
- Or, to configure for the Cursor client, with a custom max tool name length, use the URL:
197
-
198
- ```
199
- http://localhost:3000?client=cursor&capability=tool-name-length%3D40
200
- ```
201
-
202
- ## Importing the tools and server individually
203
-
204
- ```js
205
- // Import the server, generated endpoints, or the init function
206
- import { server, endpoints, init } from "profound-mcp/server";
207
-
208
- // import a specific tool
209
- import domainsOrganizations from "profound-mcp/tools/organizations/domains-organizations";
210
-
211
- // initialize the server and all endpoints
212
- init({ server, endpoints });
213
-
214
- // manually start server
215
- const transport = new StdioServerTransport();
216
- await server.connect(transport);
217
-
218
- // or initialize your own server with specific tools
219
- const myServer = new McpServer(...);
220
-
221
- // define your own endpoint
222
- const myCustomEndpoint = {
223
- tool: {
224
- name: 'my_custom_tool',
225
- description: 'My custom tool',
226
- inputSchema: zodToJsonSchema(z.object({ a_property: z.string() })),
227
- },
228
- handler: async (client: client, args: any) => {
229
- return { myResponse: 'Hello world!' };
230
- })
231
- };
232
-
233
- // initialize the server with your custom endpoints
234
- init({ server: myServer, endpoints: [domainsOrganizations, myCustomEndpoint] });
235
- ```
236
-
237
- ## Available Tools
238
-
239
- The following tools are available in this MCP server.
240
-
241
- ### Resource `organizations`:
242
-
243
- - `domains_organizations` (`read`): Get the organization domains.
244
- - `list_assets_organizations` (`read`): Get Assets
245
- - `models_organizations` (`read`): Get the organization models.
246
- - `regions_organizations` (`read`): Get the organization regions.
247
-
248
- ### Resource `organizations.categories`:
249
-
250
- - `list_organizations_categories` (`read`): Get the organization categories.
251
- - `assets_organizations_categories` (`read`): Get Category Assets
252
- - `prompts_organizations_categories` (`read`): Get Category Prompts
253
- - `tags_organizations_categories` (`read`): Get the organization tags for a specific category.
254
- - `topics_organizations_categories` (`read`): Get the organization categories.
255
-
256
- ### Resource `prompts`:
257
-
258
- - `answers_prompts` (`write`): Get the answers for the prompts.
259
-
260
- ### Resource `reports`:
261
-
262
- - `citations_reports` (`write`): Get citations for a given category.
263
- - `sentiment_reports` (`write`): Get citations for a given category.
264
- - `visibility_reports` (`write`): Query visibility report.
265
-
266
- ### Resource `logs.raw`:
267
-
268
- - `bots_logs_raw` (`write`): Get identified bot logs with filters
269
- - `logs_logs_raw` (`write`): Get all logs with filters
@@ -1,16 +1,13 @@
1
1
  import { ClientOptions } from 'profoundai';
2
2
  export type WorkerInput = {
3
- opts: ClientOptions;
3
+ project_name: string;
4
4
  code: string;
5
+ client_opts: ClientOptions;
5
6
  };
6
- export type WorkerSuccess = {
7
+ export type WorkerOutput = {
8
+ is_error: boolean;
7
9
  result: unknown | null;
8
- logLines: string[];
9
- errLines: string[];
10
- };
11
- export type WorkerError = {
12
- message: string | undefined;
13
- logLines: string[];
14
- errLines: string[];
10
+ log_lines: string[];
11
+ err_lines: string[];
15
12
  };
16
13
  //# sourceMappingURL=code-tool-types.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"code-tool-types.d.mts","sourceRoot":"","sources":["src/code-tool-types.ts"],"names":[],"mappings":"OAEO,EAAE,aAAa,EAAE,MAAM,YAAY;AAE1C,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,aAAa,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AACF,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACvB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AACF,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC"}
1
+ {"version":3,"file":"code-tool-types.d.mts","sourceRoot":"","sources":["src/code-tool-types.ts"],"names":[],"mappings":"OAEO,EAAE,aAAa,EAAE,MAAM,YAAY;AAE1C,MAAM,MAAM,WAAW,GAAG;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,aAAa,CAAC;CAC5B,CAAC;AACF,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC"}
@@ -1,16 +1,13 @@
1
1
  import { ClientOptions } from 'profoundai';
2
2
  export type WorkerInput = {
3
- opts: ClientOptions;
3
+ project_name: string;
4
4
  code: string;
5
+ client_opts: ClientOptions;
5
6
  };
6
- export type WorkerSuccess = {
7
+ export type WorkerOutput = {
8
+ is_error: boolean;
7
9
  result: unknown | null;
8
- logLines: string[];
9
- errLines: string[];
10
- };
11
- export type WorkerError = {
12
- message: string | undefined;
13
- logLines: string[];
14
- errLines: string[];
10
+ log_lines: string[];
11
+ err_lines: string[];
15
12
  };
16
13
  //# sourceMappingURL=code-tool-types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"code-tool-types.d.ts","sourceRoot":"","sources":["src/code-tool-types.ts"],"names":[],"mappings":"OAEO,EAAE,aAAa,EAAE,MAAM,YAAY;AAE1C,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,aAAa,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AACF,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACvB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AACF,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC"}
1
+ {"version":3,"file":"code-tool-types.d.ts","sourceRoot":"","sources":["src/code-tool-types.ts"],"names":[],"mappings":"OAEO,EAAE,aAAa,EAAE,MAAM,YAAY;AAE1C,MAAM,MAAM,WAAW,GAAG;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,aAAa,CAAC;CAC5B,CAAC;AACF,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC"}
package/code-tool.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { Endpoint } from "./tools/types.mjs";
1
+ import { McpTool } from "./types.mjs";
2
2
  /**
3
3
  * A tool that runs code against a copy of the SDK.
4
4
  *
@@ -8,5 +8,5 @@ import { Endpoint } from "./tools/types.mjs";
8
8
  *
9
9
  * @param endpoints - The endpoints to include in the list.
10
10
  */
11
- export declare function codeTool(): Promise<Endpoint>;
11
+ export declare function codeTool(): McpTool;
12
12
  //# sourceMappingURL=code-tool.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"code-tool.d.mts","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":"OAKO,EAAgB,QAAQ,EAA4B;AAM3D;;;;;;;;GAQG;AACH,wBAAsB,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC,CAmJlD"}
1
+ {"version":3,"file":"code-tool.d.mts","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":"OAEO,EAAE,OAAO,EAAgE;AAuBhF;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,IAAI,OAAO,CAuDlC"}
package/code-tool.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Endpoint } from "./tools/types.js";
1
+ import { McpTool } from "./types.js";
2
2
  /**
3
3
  * A tool that runs code against a copy of the SDK.
4
4
  *
@@ -8,5 +8,5 @@ import { Endpoint } from "./tools/types.js";
8
8
  *
9
9
  * @param endpoints - The endpoints to include in the list.
10
10
  */
11
- export declare function codeTool(): Promise<Endpoint>;
11
+ export declare function codeTool(): McpTool;
12
12
  //# sourceMappingURL=code-tool.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"code-tool.d.ts","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":"OAKO,EAAgB,QAAQ,EAA4B;AAM3D;;;;;;;;GAQG;AACH,wBAAsB,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC,CAmJlD"}
1
+ {"version":3,"file":"code-tool.d.ts","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":"OAEO,EAAE,OAAO,EAAgE;AAuBhF;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,IAAI,OAAO,CAuDlC"}
package/code-tool.js CHANGED
@@ -1,42 +1,26 @@
1
1
  "use strict";
2
2
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
- if (k2 === undefined) k2 = k;
5
- var desc = Object.getOwnPropertyDescriptor(m, k);
6
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
- desc = { enumerable: true, get: function() { return m[k]; } };
8
- }
9
- Object.defineProperty(o, k2, desc);
10
- }) : (function(o, m, k, k2) {
11
- if (k2 === undefined) k2 = k;
12
- o[k2] = m[k];
13
- }));
14
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
- Object.defineProperty(o, "default", { enumerable: true, value: v });
16
- }) : function(o, v) {
17
- o["default"] = v;
18
- });
19
- var __importStar = (this && this.__importStar) || (function () {
20
- var ownKeys = function(o) {
21
- ownKeys = Object.getOwnPropertyNames || function (o) {
22
- var ar = [];
23
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
- return ar;
25
- };
26
- return ownKeys(o);
27
- };
28
- return function (mod) {
29
- if (mod && mod.__esModule) return mod;
30
- var result = {};
31
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
- __setModuleDefault(result, mod);
33
- return result;
34
- };
35
- })();
36
3
  Object.defineProperty(exports, "__esModule", { value: true });
37
4
  exports.codeTool = codeTool;
38
- const node_path_1 = require("node:path");
39
- const node_url_1 = require("node:url");
5
+ const types_1 = require("./types.js");
6
+ const server_1 = require("./server.js");
7
+ const prompt = `Runs JavaScript code to interact with the Profound API.
8
+
9
+ You are a skilled programmer writing code to interface with the service.
10
+ Define an async function named "run" that takes a single parameter of an initialized SDK client and it will be run.
11
+ For example:
12
+
13
+ \`\`\`
14
+ async function run(client) {
15
+ const orgItems = await client.organizations.categories.list();
16
+ }
17
+ \`\`\`
18
+
19
+ You will be returned anything that your function returns, plus the results of any console.log statements.
20
+ Do not add try-catch blocks for single API calls. The tool will handle errors for you.
21
+ Do not add comments unless necessary for generating better code.
22
+ Code will run in a container, and cannot interact with the network outside of the given SDK client.
23
+ Variables will not persist between calls, so make sure to return or log any data you might need later.`;
40
24
  /**
41
25
  * A tool that runs code against a copy of the SDK.
42
26
  *
@@ -46,125 +30,49 @@ const node_url_1 = require("node:url");
46
30
  *
47
31
  * @param endpoints - The endpoints to include in the list.
48
32
  */
49
- async function codeTool() {
33
+ function codeTool() {
50
34
  const metadata = { resource: 'all', operation: 'write', tags: [] };
51
35
  const tool = {
52
36
  name: 'execute',
53
- description: 'Runs JavaScript code to interact with the API.\n\nYou are a skilled programmer writing code to interface with the service.\nDefine an async function named "run" that takes a single parameter of an initialized client named "client", and it will be run.\nWrite code within this template:\n\n```\nasync function run(client) {\n // Fill this out\n}\n```\n\nYou will be returned anything that your function returns, plus the results of any console.log statements.\nIf any code triggers an error, the tool will return an error response, so you do not need to add error handling unless you want to output something more helpful than the raw error.\nIt is not necessary to add comments to code, unless by adding those comments you believe that you can generate better code.\nThis code will run in a container, and you will not be able to use fetch or otherwise interact with the network calls other than through the client you are given.\nAny variables you define won\'t live between successive uses of this call, so make sure to return or log any data you might need later.',
37
+ description: prompt,
54
38
  inputSchema: { type: 'object', properties: { code: { type: 'string' } } },
55
39
  };
56
- // Import dynamically to avoid failing at import time in cases where the environment is not well-supported.
57
- const { newDenoHTTPWorker } = await Promise.resolve().then(() => __importStar(require('@valtown/deno-http-worker')));
58
- const { workerPath } = await Promise.resolve().then(() => __importStar(require('./code-tool-paths.cjs')));
59
- const handler = async (client, args) => {
60
- const baseURLHostname = new URL(client.baseURL).hostname;
61
- const { code } = args;
62
- const worker = await newDenoHTTPWorker((0, node_url_1.pathToFileURL)(workerPath), {
63
- runFlags: [
64
- `--node-modules-dir=manual`,
65
- `--allow-read=code-tool-worker.mjs,${workerPath.replace(/([\/\\]node_modules)[\/\\].+$/, '$1')}/`,
66
- `--allow-net=${baseURLHostname}`,
67
- // Allow environment variables because instantiating the client will try to read from them,
68
- // even though they are not set.
69
- '--allow-env',
70
- ],
71
- printOutput: true,
72
- spawnOptions: {
73
- cwd: (0, node_path_1.dirname)(workerPath),
40
+ const handler = async (_, args) => {
41
+ const code = args.code;
42
+ // this is not required, but passing a Stainless API key for the matching project_name
43
+ // will allow you to run code-mode queries against non-published versions of your SDK.
44
+ const stainlessAPIKey = (0, server_1.readEnv)('STAINLESS_API_KEY');
45
+ const codeModeEndpoint = (0, server_1.readEnv)('CODE_MODE_ENDPOINT_URL') ?? 'https://api.stainless.com/api/ai/code-tool';
46
+ const res = await fetch(codeModeEndpoint, {
47
+ method: 'POST',
48
+ headers: {
49
+ ...(stainlessAPIKey && { Authorization: stainlessAPIKey }),
50
+ 'Content-Type': 'application/json',
51
+ client_envs: JSON.stringify({
52
+ PROFOUND_API_KEY: (0, server_1.readEnvOrError)('PROFOUND_API_KEY'),
53
+ PROFOUND_BASE_URL: (0, server_1.readEnv)('PROFOUND_BASE_URL'),
54
+ }),
74
55
  },
56
+ body: JSON.stringify({
57
+ project_name: 'profound',
58
+ code,
59
+ client_opts: {},
60
+ }),
75
61
  });
76
- try {
77
- const resp = await new Promise((resolve, reject) => {
78
- worker.addEventListener('exit', (exitCode) => {
79
- reject(new Error(`Worker exited with code ${exitCode}`));
80
- });
81
- const opts = {
82
- baseURL: client.baseURL,
83
- apiKey: client.apiKey,
84
- defaultHeaders: {
85
- 'X-Stainless-MCP': 'true',
86
- },
87
- };
88
- const req = worker.request('http://localhost', {
89
- headers: {
90
- 'content-type': 'application/json',
91
- },
92
- method: 'POST',
93
- }, (resp) => {
94
- const body = [];
95
- resp.on('error', (err) => {
96
- reject(err);
97
- });
98
- resp.on('data', (chunk) => {
99
- body.push(chunk);
100
- });
101
- resp.on('end', () => {
102
- resolve(new Response(Buffer.concat(body).toString(), {
103
- status: resp.statusCode ?? 200,
104
- headers: resp.headers,
105
- }));
106
- });
107
- });
108
- const body = JSON.stringify({
109
- opts,
110
- code,
111
- });
112
- req.write(body, (err) => {
113
- if (err != null) {
114
- reject(err);
115
- }
116
- });
117
- req.end();
118
- });
119
- if (resp.status === 200) {
120
- const { result, logLines, errLines } = (await resp.json());
121
- const returnOutput = result == null ? null : ({
122
- type: 'text',
123
- text: typeof result === 'string' ? result : JSON.stringify(result),
124
- });
125
- const logOutput = logLines.length === 0 ?
126
- null
127
- : {
128
- type: 'text',
129
- text: logLines.join('\n'),
130
- };
131
- const errOutput = errLines.length === 0 ?
132
- null
133
- : {
134
- type: 'text',
135
- text: 'Error output:\n' + errLines.join('\n'),
136
- };
137
- return {
138
- content: [returnOutput, logOutput, errOutput].filter((block) => block !== null),
139
- };
140
- }
141
- else {
142
- const { message, logLines, errLines } = (await resp.json());
143
- const messageOutput = message == null ? null : ({
144
- type: 'text',
145
- text: message,
146
- });
147
- const logOutput = logLines.length === 0 ?
148
- null
149
- : {
150
- type: 'text',
151
- text: logLines.join('\n'),
152
- };
153
- const errOutput = errLines.length === 0 ?
154
- null
155
- : {
156
- type: 'text',
157
- text: 'Error output:\n' + errLines.join('\n'),
158
- };
159
- return {
160
- content: [messageOutput, logOutput, errOutput].filter((block) => block !== null),
161
- isError: true,
162
- };
163
- }
62
+ if (!res.ok) {
63
+ throw new Error(`${res.status}: ${res.statusText} error when trying to contact Code Tool server. Details: ${await res.text()}`);
164
64
  }
165
- finally {
166
- worker.terminate();
65
+ const { is_error, result, log_lines, err_lines } = (await res.json());
66
+ const hasLogs = log_lines.length > 0 || err_lines.length > 0;
67
+ const output = {
68
+ result,
69
+ ...(log_lines.length > 0 && { log_lines }),
70
+ ...(err_lines.length > 0 && { err_lines }),
71
+ };
72
+ if (is_error) {
73
+ return (0, types_1.asErrorResult)(typeof result === 'string' && !hasLogs ? result : JSON.stringify(output, null, 2));
167
74
  }
75
+ return (0, types_1.asTextContentResult)(output);
168
76
  };
169
77
  return { metadata, tool, handler };
170
78
  }
package/code-tool.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"code-tool.js","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBtF,4BAmJC;AArKD,yCAAoC;AACpC,uCAAyC;AAQzC;;;;;;;;GAQG;AACI,KAAK,UAAU,QAAQ;IAC5B,MAAM,QAAQ,GAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;IAC7E,MAAM,IAAI,GAAS;QACjB,IAAI,EAAE,SAAS;QACf,WAAW,EACT,6iCAA6iC;QAC/iC,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE;KAC1E,CAAC;IAEF,2GAA2G;IAC3G,MAAM,EAAE,iBAAiB,EAAE,GAAG,wDAAa,2BAA2B,GAAC,CAAC;IACxE,MAAM,EAAE,UAAU,EAAE,GAAG,wDAAa,uBAAuB,GAAC,CAAC;IAE7D,MAAM,OAAO,GAAG,KAAK,EAAE,MAAgB,EAAE,IAAa,EAA2B,EAAE;QACjF,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC;QACzD,MAAM,EAAE,IAAI,EAAE,GAAG,IAAwB,CAAC;QAE1C,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC,IAAA,wBAAa,EAAC,UAAU,CAAC,EAAE;YAChE,QAAQ,EAAE;gBACR,2BAA2B;gBAC3B,qCAAqC,UAAU,CAAC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