@beeper/desktop-mcp 0.1.5 → 4.1.293
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 +8 -7
- package/docs-search-tool.d.mts +44 -0
- package/docs-search-tool.d.mts.map +1 -0
- package/docs-search-tool.d.ts +44 -0
- package/docs-search-tool.d.ts.map +1 -0
- package/docs-search-tool.js +43 -0
- package/docs-search-tool.js.map +1 -0
- package/docs-search-tool.mjs +39 -0
- package/docs-search-tool.mjs.map +1 -0
- package/options.d.mts +1 -0
- package/options.d.mts.map +1 -1
- package/options.d.ts +1 -0
- package/options.d.ts.map +1 -1
- package/options.js +13 -6
- package/options.js.map +1 -1
- package/options.mjs +13 -6
- package/options.mjs.map +1 -1
- package/package.json +12 -2
- package/server.d.mts.map +1 -1
- package/server.d.ts.map +1 -1
- package/server.js +8 -4
- package/server.js.map +1 -1
- package/server.mjs +8 -4
- package/server.mjs.map +1 -1
- package/src/docs-search-tool.ts +48 -0
- package/src/options.ts +17 -7
- package/src/server.ts +8 -5
- package/src/tools/accounts/get-accounts.ts +3 -3
- package/src/tools/chats/archive-chat.ts +6 -6
- package/src/tools/chats/get-chat.ts +6 -7
- package/src/tools/chats/reminders/clear-chat-reminder.ts +10 -8
- package/src/tools/chats/reminders/set-chat-reminder.ts +6 -5
- package/src/tools/chats/search-chats.ts +5 -5
- package/src/tools/index.ts +6 -4
- package/src/tools/messages/list-messages.ts +51 -0
- package/src/tools/messages/search-messages.ts +6 -7
- package/src/tools/messages/send-message.ts +5 -5
- package/src/tools/{app/open-in-app.ts → top-level/focus-app.ts} +6 -6
- package/src/tools/{app → top-level}/search.ts +3 -3
- package/tools/accounts/get-accounts.js +3 -3
- package/tools/accounts/get-accounts.js.map +1 -1
- package/tools/accounts/get-accounts.mjs +3 -3
- package/tools/accounts/get-accounts.mjs.map +1 -1
- package/tools/chats/archive-chat.d.mts.map +1 -1
- package/tools/chats/archive-chat.d.ts.map +1 -1
- package/tools/chats/archive-chat.js +6 -5
- package/tools/chats/archive-chat.js.map +1 -1
- package/tools/chats/archive-chat.mjs +6 -5
- package/tools/chats/archive-chat.mjs.map +1 -1
- package/tools/chats/get-chat.d.mts.map +1 -1
- package/tools/chats/get-chat.d.ts.map +1 -1
- package/tools/chats/get-chat.js +6 -6
- package/tools/chats/get-chat.js.map +1 -1
- package/tools/chats/get-chat.mjs +6 -6
- package/tools/chats/get-chat.mjs.map +1 -1
- package/tools/chats/reminders/clear-chat-reminder.d.mts.map +1 -1
- package/tools/chats/reminders/clear-chat-reminder.d.ts.map +1 -1
- package/tools/chats/reminders/clear-chat-reminder.js +10 -7
- package/tools/chats/reminders/clear-chat-reminder.js.map +1 -1
- package/tools/chats/reminders/clear-chat-reminder.mjs +10 -7
- package/tools/chats/reminders/clear-chat-reminder.mjs.map +1 -1
- package/tools/chats/reminders/set-chat-reminder.d.mts.map +1 -1
- package/tools/chats/reminders/set-chat-reminder.d.ts.map +1 -1
- package/tools/chats/reminders/set-chat-reminder.js +6 -5
- package/tools/chats/reminders/set-chat-reminder.js.map +1 -1
- package/tools/chats/reminders/set-chat-reminder.mjs +6 -5
- package/tools/chats/reminders/set-chat-reminder.mjs.map +1 -1
- package/tools/chats/search-chats.js +5 -5
- package/tools/chats/search-chats.js.map +1 -1
- package/tools/chats/search-chats.mjs +5 -5
- package/tools/chats/search-chats.mjs.map +1 -1
- package/tools/index.d.mts.map +1 -1
- package/tools/index.d.ts.map +1 -1
- package/tools/index.js +6 -4
- package/tools/index.js.map +1 -1
- package/tools/index.mjs +6 -4
- package/tools/index.mjs.map +1 -1
- package/tools/messages/list-messages.d.mts +45 -0
- package/tools/messages/list-messages.d.mts.map +1 -0
- package/tools/messages/list-messages.d.ts +45 -0
- package/tools/messages/list-messages.d.ts.map +1 -0
- package/tools/messages/list-messages.js +47 -0
- package/tools/messages/list-messages.js.map +1 -0
- package/tools/messages/list-messages.mjs +43 -0
- package/tools/messages/list-messages.mjs.map +1 -0
- package/tools/messages/search-messages.d.mts.map +1 -1
- package/tools/messages/search-messages.d.ts.map +1 -1
- package/tools/messages/search-messages.js +6 -6
- package/tools/messages/search-messages.js.map +1 -1
- package/tools/messages/search-messages.mjs +6 -6
- package/tools/messages/search-messages.mjs.map +1 -1
- package/tools/messages/send-message.js +5 -5
- package/tools/messages/send-message.js.map +1 -1
- package/tools/messages/send-message.mjs +5 -5
- package/tools/messages/send-message.mjs.map +1 -1
- package/tools/{app/open-in-app.d.ts → top-level/focus-app.d.mts} +1 -1
- package/tools/top-level/focus-app.d.mts.map +1 -0
- package/tools/{app/open-in-app.d.mts → top-level/focus-app.d.ts} +1 -1
- package/tools/top-level/focus-app.d.ts.map +1 -0
- package/tools/{app/open-in-app.js → top-level/focus-app.js} +7 -7
- package/tools/top-level/focus-app.js.map +1 -0
- package/tools/{app/open-in-app.mjs → top-level/focus-app.mjs} +7 -7
- package/tools/top-level/focus-app.mjs.map +1 -0
- package/tools/top-level/search.d.mts.map +1 -0
- package/tools/top-level/search.d.ts.map +1 -0
- package/tools/{app → top-level}/search.js +3 -3
- package/tools/top-level/search.js.map +1 -0
- package/tools/{app → top-level}/search.mjs +3 -3
- package/tools/top-level/search.mjs.map +1 -0
- package/tools/app/open-in-app.d.mts.map +0 -1
- package/tools/app/open-in-app.d.ts.map +0 -1
- package/tools/app/open-in-app.js.map +0 -1
- package/tools/app/open-in-app.mjs.map +0 -1
- package/tools/app/search.d.mts.map +0 -1
- package/tools/app/search.d.ts.map +0 -1
- package/tools/app/search.js.map +0 -1
- package/tools/app/search.mjs.map +0 -1
- /package/tools/{app → top-level}/search.d.mts +0 -0
- /package/tools/{app → top-level}/search.d.ts +0 -0
package/server.js
CHANGED
|
@@ -15,13 +15,14 @@ const desktop_api_1 = __importDefault(require("@beeper/desktop-api"));
|
|
|
15
15
|
const compat_1 = require("./compat.js");
|
|
16
16
|
const dynamic_tools_1 = require("./dynamic-tools.js");
|
|
17
17
|
const code_tool_1 = require("./code-tool.js");
|
|
18
|
+
const docs_search_tool_1 = __importDefault(require("./docs-search-tool.js"));
|
|
18
19
|
var compat_2 = require("./compat.js");
|
|
19
20
|
Object.defineProperty(exports, "ClientType", { enumerable: true, get: function () { return compat_2.ClientType; } });
|
|
20
21
|
var tools_2 = require("./tools.js");
|
|
21
22
|
Object.defineProperty(exports, "endpoints", { enumerable: true, get: function () { return tools_2.endpoints; } });
|
|
22
23
|
const newMcpServer = () => new mcp_js_1.McpServer({
|
|
23
24
|
name: 'beeper_desktop_api_api',
|
|
24
|
-
version: '
|
|
25
|
+
version: '4.1.293',
|
|
25
26
|
}, {
|
|
26
27
|
capabilities: { tools: {}, logging: {} },
|
|
27
28
|
instructions: 'Access to all chats and messages across networks using Beeper Desktop. Can be used to find, get, send, and manage messages and chats.',
|
|
@@ -119,7 +120,7 @@ function initMcpServer(params) {
|
|
|
119
120
|
*/
|
|
120
121
|
async function selectTools(endpoints, options) {
|
|
121
122
|
const filteredEndpoints = (0, tools_1.query)(options?.filters ?? [], endpoints);
|
|
122
|
-
let includedTools = filteredEndpoints;
|
|
123
|
+
let includedTools = filteredEndpoints.slice();
|
|
123
124
|
if (includedTools.length > 0) {
|
|
124
125
|
if (options?.includeDynamicTools) {
|
|
125
126
|
includedTools = (0, dynamic_tools_1.dynamicTools)(includedTools);
|
|
@@ -127,7 +128,7 @@ async function selectTools(endpoints, options) {
|
|
|
127
128
|
}
|
|
128
129
|
else {
|
|
129
130
|
if (options?.includeAllTools) {
|
|
130
|
-
includedTools = endpoints;
|
|
131
|
+
includedTools = endpoints.slice();
|
|
131
132
|
}
|
|
132
133
|
else if (options?.includeDynamicTools) {
|
|
133
134
|
includedTools = (0, dynamic_tools_1.dynamicTools)(endpoints);
|
|
@@ -136,9 +137,12 @@ async function selectTools(endpoints, options) {
|
|
|
136
137
|
includedTools = [await (0, code_tool_1.codeTool)()];
|
|
137
138
|
}
|
|
138
139
|
else {
|
|
139
|
-
includedTools = endpoints;
|
|
140
|
+
includedTools = endpoints.slice();
|
|
140
141
|
}
|
|
141
142
|
}
|
|
143
|
+
if (options?.includeDocsTools ?? true) {
|
|
144
|
+
includedTools.push(docs_search_tool_1.default);
|
|
145
|
+
}
|
|
142
146
|
const capabilities = { ...compat_1.defaultClientCapabilities, ...options?.capabilities };
|
|
143
147
|
return (0, compat_1.applyCompatibilityTransformations)(includedTools, capabilities);
|
|
144
148
|
}
|
package/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["src/server.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["src/server.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;AAoDtF,sCA8FC;AAKD,kCAyBC;AAKD,wCAYC;AA9LD,oEAAoE;AACpE,sCAAsE;AACtE,iEAM4C;AAE5C,sEAAgD;AAChD,wCAMkB;AAClB,sDAA+C;AAC/C,8CAAuC;AACvC,6EAAgD;AAIhD,sCAAsC;AAA7B,oGAAA,UAAU,OAAA;AAGnB,oCAAoC;AAA3B,kGAAA,SAAS,OAAA;AAEX,MAAM,YAAY,GAAG,GAAG,EAAE,CAC/B,IAAI,kBAAS,CACX;IACE,IAAI,EAAE,wBAAwB;IAC9B,OAAO,EAAE,SAAS;CACnB,EACD;IACE,YAAY,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;IACxC,YAAY,EACV,uIAAuI;CAC1I,CACF,CAAC;AAXS,QAAA,YAAY,gBAWrB;AAEJ,yBAAyB;AACZ,QAAA,MAAM,GAAG,IAAA,oBAAY,GAAE,CAAC;AAErC;;;GAGG;AACH,SAAgB,aAAa,CAAC,MAI7B;IACC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,YAAY,kBAAS,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;IACzF,MAAM,UAAU,GA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;AAEM,MAAM,OAAO,GAAG,CAAC,GAAW,EAAsB,EAAE;IACzD,IAAI,OAAQ,UAAkB,CAAC,OAAO,KAAK,WAAW,EAAE,CAAC;QACvD,OAAQ,UAAkB,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC;IACxD,CAAC;SAAM,IAAI,OAAQ,UAAkB,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;QAC3D,OAAQ,UAAkB,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC;IAC1D,CAAC;IACD,OAAO;AACT,CAAC,CAAC;AAPW,QAAA,OAAO,WAOlB;AAEK,MAAM,cAAc,GAAG,CAAC,GAAW,EAAU,EAAE;IACpD,IAAI,QAAQ,GAAG,IAAA,eAAO,EAAC,GAAG,CAAC,CAAC;IAC5B,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CAAC,wBAAwB,GAAG,aAAa,CAAC,CAAC;IAC5D,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AANW,QAAA,cAAc,kBAMzB"}
|
package/server.mjs
CHANGED
|
@@ -6,11 +6,12 @@ import BeeperDesktop from '@beeper/desktop-api';
|
|
|
6
6
|
import { applyCompatibilityTransformations, defaultClientCapabilities, knownClients, parseEmbeddedJSON, } from "./compat.mjs";
|
|
7
7
|
import { dynamicTools } from "./dynamic-tools.mjs";
|
|
8
8
|
import { codeTool } from "./code-tool.mjs";
|
|
9
|
+
import docsSearchTool from "./docs-search-tool.mjs";
|
|
9
10
|
export { ClientType } from "./compat.mjs";
|
|
10
11
|
export { endpoints } from "./tools.mjs";
|
|
11
12
|
export const newMcpServer = () => new McpServer({
|
|
12
13
|
name: 'beeper_desktop_api_api',
|
|
13
|
-
version: '
|
|
14
|
+
version: '4.1.293',
|
|
14
15
|
}, {
|
|
15
16
|
capabilities: { tools: {}, logging: {} },
|
|
16
17
|
instructions: 'Access to all chats and messages across networks using Beeper Desktop. Can be used to find, get, send, and manage messages and chats.',
|
|
@@ -107,7 +108,7 @@ export function initMcpServer(params) {
|
|
|
107
108
|
*/
|
|
108
109
|
export async function selectTools(endpoints, options) {
|
|
109
110
|
const filteredEndpoints = query(options?.filters ?? [], endpoints);
|
|
110
|
-
let includedTools = filteredEndpoints;
|
|
111
|
+
let includedTools = filteredEndpoints.slice();
|
|
111
112
|
if (includedTools.length > 0) {
|
|
112
113
|
if (options?.includeDynamicTools) {
|
|
113
114
|
includedTools = dynamicTools(includedTools);
|
|
@@ -115,7 +116,7 @@ export async function selectTools(endpoints, options) {
|
|
|
115
116
|
}
|
|
116
117
|
else {
|
|
117
118
|
if (options?.includeAllTools) {
|
|
118
|
-
includedTools = endpoints;
|
|
119
|
+
includedTools = endpoints.slice();
|
|
119
120
|
}
|
|
120
121
|
else if (options?.includeDynamicTools) {
|
|
121
122
|
includedTools = dynamicTools(endpoints);
|
|
@@ -124,9 +125,12 @@ export async function selectTools(endpoints, options) {
|
|
|
124
125
|
includedTools = [await codeTool()];
|
|
125
126
|
}
|
|
126
127
|
else {
|
|
127
|
-
includedTools = endpoints;
|
|
128
|
+
includedTools = endpoints.slice();
|
|
128
129
|
}
|
|
129
130
|
}
|
|
131
|
+
if (options?.includeDocsTools ?? true) {
|
|
132
|
+
includedTools.push(docsSearchTool);
|
|
133
|
+
}
|
|
130
134
|
const capabilities = { ...defaultClientCapabilities, ...options?.capabilities };
|
|
131
135
|
return applyCompatibilityTransformations(includedTools, capabilities);
|
|
132
136
|
}
|
package/server.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.mjs","sourceRoot":"","sources":["src/server.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAG/E,EAAE,SAAS,EAAE,MAAM,yCAAyC;OAC5D,EAAY,SAAS,EAAmB,KAAK,EAAE;OAC/C,EACL,qBAAqB,EACrB,sB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O,KAAK,WAAW,EAAE,CAAC;QACvD,OAAQ,UAAkB,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC;IACxD,CAAC;SAAM,IAAI,OAAQ,UAAkB,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;QAC3D,OAAQ,UAAkB,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC;IAC1D,CAAC;IACD,OAAO;AACT,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,GAAW,EAAU,EAAE;IACpD,IAAI,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAC5B,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CAAC,wBAAwB,GAAG,aAAa,CAAC,CAAC;IAC5D,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { Metadata, asTextContentResult } from './tools/types';
|
|
4
|
+
|
|
5
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
6
|
+
|
|
7
|
+
export const metadata: Metadata = {
|
|
8
|
+
resource: 'all',
|
|
9
|
+
operation: 'read',
|
|
10
|
+
tags: [],
|
|
11
|
+
httpMethod: 'get',
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const tool: Tool = {
|
|
15
|
+
name: 'search_docs',
|
|
16
|
+
description:
|
|
17
|
+
'Search for documentation for how to use the client to interact with the API.\nThe tool will return an array of Markdown-formatted documentation pages.',
|
|
18
|
+
inputSchema: {
|
|
19
|
+
type: 'object',
|
|
20
|
+
properties: {
|
|
21
|
+
query: {
|
|
22
|
+
type: 'string',
|
|
23
|
+
description: 'The query to search for.',
|
|
24
|
+
},
|
|
25
|
+
language: {
|
|
26
|
+
type: 'string',
|
|
27
|
+
description: 'The language for the SDK to search for.',
|
|
28
|
+
enum: ['http', 'python', 'go', 'typescript', 'terraform', 'ruby', 'java', 'kotlin'],
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
required: ['query', 'language'],
|
|
32
|
+
},
|
|
33
|
+
annotations: {
|
|
34
|
+
readOnlyHint: true,
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const docsSearchURL =
|
|
39
|
+
process.env['DOCS_SEARCH_URL'] || 'https://api.stainless.com/api/projects/beeper-desktop-api/docs/search';
|
|
40
|
+
|
|
41
|
+
export const handler = async (_: unknown, args: Record<string, unknown> | undefined) => {
|
|
42
|
+
const body = args as any;
|
|
43
|
+
const query = new URLSearchParams(body).toString();
|
|
44
|
+
const result = await fetch(`${docsSearchURL}?${query}`);
|
|
45
|
+
return asTextContentResult(await result.json());
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export default { metadata, tool, handler };
|
package/src/options.ts
CHANGED
|
@@ -17,6 +17,7 @@ export type McpOptions = {
|
|
|
17
17
|
includeDynamicTools?: boolean | undefined;
|
|
18
18
|
includeAllTools?: boolean | undefined;
|
|
19
19
|
includeCodeTools?: boolean | undefined;
|
|
20
|
+
includeDocsTools?: boolean | undefined;
|
|
20
21
|
filters?: Filter[] | undefined;
|
|
21
22
|
capabilities?: Partial<ClientCapabilities> | undefined;
|
|
22
23
|
};
|
|
@@ -55,13 +56,13 @@ export function parseCLIOptions(): CLIOptions {
|
|
|
55
56
|
.option('tools', {
|
|
56
57
|
type: 'string',
|
|
57
58
|
array: true,
|
|
58
|
-
choices: ['dynamic', 'all', 'code'],
|
|
59
|
+
choices: ['dynamic', 'all', 'code', 'docs'],
|
|
59
60
|
description: 'Use dynamic tools or all tools',
|
|
60
61
|
})
|
|
61
62
|
.option('no-tools', {
|
|
62
63
|
type: 'string',
|
|
63
64
|
array: true,
|
|
64
|
-
choices: ['dynamic', 'all', 'code'],
|
|
65
|
+
choices: ['dynamic', 'all', 'code', 'docs'],
|
|
65
66
|
description: 'Do not use any dynamic or all tools',
|
|
66
67
|
})
|
|
67
68
|
.option('tool', {
|
|
@@ -245,13 +246,15 @@ export function parseCLIOptions(): CLIOptions {
|
|
|
245
246
|
}
|
|
246
247
|
}
|
|
247
248
|
|
|
248
|
-
const shouldIncludeToolType = (toolType: 'dynamic' | 'all' | 'code') =>
|
|
249
|
-
|
|
249
|
+
const shouldIncludeToolType = (toolType: 'dynamic' | 'all' | 'code' | 'docs') =>
|
|
250
|
+
argv.noTools?.includes(toolType) ? false
|
|
251
|
+
: argv.tools?.includes(toolType) ? true
|
|
252
|
+
: undefined;
|
|
250
253
|
|
|
251
|
-
const explicitTools = Boolean(argv.tools || argv.noTools);
|
|
252
254
|
const includeDynamicTools = shouldIncludeToolType('dynamic');
|
|
253
255
|
const includeAllTools = shouldIncludeToolType('all');
|
|
254
256
|
const includeCodeTools = shouldIncludeToolType('code');
|
|
257
|
+
const includeDocsTools = shouldIncludeToolType('docs');
|
|
255
258
|
|
|
256
259
|
const transport = argv.transport as 'stdio' | 'http';
|
|
257
260
|
|
|
@@ -261,6 +264,7 @@ export function parseCLIOptions(): CLIOptions {
|
|
|
261
264
|
includeDynamicTools,
|
|
262
265
|
includeAllTools,
|
|
263
266
|
includeCodeTools,
|
|
267
|
+
includeDocsTools,
|
|
264
268
|
filters,
|
|
265
269
|
capabilities: clientCapabilities,
|
|
266
270
|
list: argv.list || false,
|
|
@@ -280,8 +284,8 @@ const coerceArray = <T extends z.ZodTypeAny>(zodType: T) =>
|
|
|
280
284
|
);
|
|
281
285
|
|
|
282
286
|
const QueryOptions = z.object({
|
|
283
|
-
tools: coerceArray(z.enum(['dynamic', 'all'])).describe('Use dynamic tools or all tools'),
|
|
284
|
-
no_tools: coerceArray(z.enum(['dynamic', 'all'])).describe('Do not use dynamic tools or all tools'),
|
|
287
|
+
tools: coerceArray(z.enum(['dynamic', 'all', 'docs'])).describe('Use dynamic tools or all tools'),
|
|
288
|
+
no_tools: coerceArray(z.enum(['dynamic', 'all', 'docs'])).describe('Do not use dynamic tools or all tools'),
|
|
285
289
|
tool: coerceArray(z.string()).describe('Include tools matching the specified names'),
|
|
286
290
|
resource: coerceArray(z.string()).describe('Include tools matching the specified resources'),
|
|
287
291
|
operation: coerceArray(z.enum(['read', 'write'])).describe(
|
|
@@ -376,11 +380,17 @@ export function parseQueryOptions(defaultOptions: McpOptions, query: unknown): M
|
|
|
376
380
|
: queryOptions.tools?.includes('all') ? true
|
|
377
381
|
: defaultOptions.includeAllTools;
|
|
378
382
|
|
|
383
|
+
let docsTools: boolean | undefined =
|
|
384
|
+
queryOptions.no_tools && queryOptions.no_tools?.includes('docs') ? false
|
|
385
|
+
: queryOptions.tools?.includes('docs') ? true
|
|
386
|
+
: defaultOptions.includeDocsTools;
|
|
387
|
+
|
|
379
388
|
return {
|
|
380
389
|
client: queryOptions.client ?? defaultOptions.client,
|
|
381
390
|
includeDynamicTools: dynamicTools,
|
|
382
391
|
includeAllTools: allTools,
|
|
383
392
|
includeCodeTools: undefined,
|
|
393
|
+
includeDocsTools: docsTools,
|
|
384
394
|
filters,
|
|
385
395
|
capabilities: clientCapabilities,
|
|
386
396
|
};
|
package/src/server.ts
CHANGED
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
} from './compat';
|
|
22
22
|
import { dynamicTools } from './dynamic-tools';
|
|
23
23
|
import { codeTool } from './code-tool';
|
|
24
|
+
import docsSearchTool from './docs-search-tool';
|
|
24
25
|
import { McpOptions } from './options';
|
|
25
26
|
|
|
26
27
|
export { McpOptions } from './options';
|
|
@@ -33,7 +34,7 @@ export const newMcpServer = () =>
|
|
|
33
34
|
new McpServer(
|
|
34
35
|
{
|
|
35
36
|
name: 'beeper_desktop_api_api',
|
|
36
|
-
version: '
|
|
37
|
+
version: '4.1.293',
|
|
37
38
|
},
|
|
38
39
|
{
|
|
39
40
|
capabilities: { tools: {}, logging: {} },
|
|
@@ -151,7 +152,7 @@ export function initMcpServer(params: {
|
|
|
151
152
|
export async function selectTools(endpoints: Endpoint[], options?: McpOptions): Promise<Endpoint[]> {
|
|
152
153
|
const filteredEndpoints = query(options?.filters ?? [], endpoints);
|
|
153
154
|
|
|
154
|
-
let includedTools = filteredEndpoints;
|
|
155
|
+
let includedTools = filteredEndpoints.slice();
|
|
155
156
|
|
|
156
157
|
if (includedTools.length > 0) {
|
|
157
158
|
if (options?.includeDynamicTools) {
|
|
@@ -159,16 +160,18 @@ export async function selectTools(endpoints: Endpoint[], options?: McpOptions):
|
|
|
159
160
|
}
|
|
160
161
|
} else {
|
|
161
162
|
if (options?.includeAllTools) {
|
|
162
|
-
includedTools = endpoints;
|
|
163
|
+
includedTools = endpoints.slice();
|
|
163
164
|
} else if (options?.includeDynamicTools) {
|
|
164
165
|
includedTools = dynamicTools(endpoints);
|
|
165
166
|
} else if (options?.includeCodeTools) {
|
|
166
167
|
includedTools = [await codeTool()];
|
|
167
168
|
} else {
|
|
168
|
-
includedTools = endpoints;
|
|
169
|
+
includedTools = endpoints.slice();
|
|
169
170
|
}
|
|
170
171
|
}
|
|
171
|
-
|
|
172
|
+
if (options?.includeDocsTools ?? true) {
|
|
173
|
+
includedTools.push(docsSearchTool);
|
|
174
|
+
}
|
|
172
175
|
const capabilities = { ...defaultClientCapabilities, ...options?.capabilities };
|
|
173
176
|
return applyCompatibilityTransformations(includedTools, capabilities);
|
|
174
177
|
}
|
|
@@ -10,13 +10,13 @@ export const metadata: Metadata = {
|
|
|
10
10
|
operation: 'read',
|
|
11
11
|
tags: ['accounts'],
|
|
12
12
|
httpMethod: 'get',
|
|
13
|
-
httpPath: '/
|
|
14
|
-
operationId: '
|
|
13
|
+
httpPath: '/v1/accounts',
|
|
14
|
+
operationId: 'getAccounts',
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
export const tool: Tool = {
|
|
18
18
|
name: 'get_accounts',
|
|
19
|
-
description: 'List connected accounts on this device.
|
|
19
|
+
description: 'List connected accounts on this device.',
|
|
20
20
|
inputSchema: {
|
|
21
21
|
type: 'object',
|
|
22
22
|
properties: {},
|
|
@@ -10,8 +10,8 @@ export const metadata: Metadata = {
|
|
|
10
10
|
operation: 'write',
|
|
11
11
|
tags: ['chats'],
|
|
12
12
|
httpMethod: 'post',
|
|
13
|
-
httpPath: '/
|
|
14
|
-
operationId: '
|
|
13
|
+
httpPath: '/v1/chats/{chatID}/archive',
|
|
14
|
+
operationId: 'archiveChat',
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
export const tool: Tool = {
|
|
@@ -22,8 +22,7 @@ export const tool: Tool = {
|
|
|
22
22
|
properties: {
|
|
23
23
|
chatID: {
|
|
24
24
|
type: 'string',
|
|
25
|
-
description:
|
|
26
|
-
'The identifier of the chat to archive or unarchive (accepts both chatID and local chat ID)',
|
|
25
|
+
description: 'Unique identifier of the chat.',
|
|
27
26
|
},
|
|
28
27
|
archived: {
|
|
29
28
|
type: 'boolean',
|
|
@@ -36,8 +35,9 @@ export const tool: Tool = {
|
|
|
36
35
|
};
|
|
37
36
|
|
|
38
37
|
export const handler = async (client: BeeperDesktop, args: Record<string, unknown> | undefined) => {
|
|
39
|
-
const body = args as any;
|
|
40
|
-
|
|
38
|
+
const { chatID, ...body } = args as any;
|
|
39
|
+
const response = await client.chats.archive(chatID, body).asResponse();
|
|
40
|
+
return asTextContentResult(await response.text());
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
export default { metadata, tool, handler };
|
|
@@ -10,8 +10,8 @@ export const metadata: Metadata = {
|
|
|
10
10
|
operation: 'read',
|
|
11
11
|
tags: ['chats'],
|
|
12
12
|
httpMethod: 'get',
|
|
13
|
-
httpPath: '/
|
|
14
|
-
operationId: '
|
|
13
|
+
httpPath: '/v1/chats/{chatID}',
|
|
14
|
+
operationId: 'getChat',
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
export const tool: Tool = {
|
|
@@ -22,13 +22,12 @@ export const tool: Tool = {
|
|
|
22
22
|
properties: {
|
|
23
23
|
chatID: {
|
|
24
24
|
type: 'string',
|
|
25
|
-
description:
|
|
26
|
-
"Unique identifier of the chat to retrieve. Not available for iMessage chats. Participants are limited by 'maxParticipantCount'.",
|
|
25
|
+
description: 'Unique identifier of the chat.',
|
|
27
26
|
},
|
|
28
27
|
maxParticipantCount: {
|
|
29
28
|
type: 'integer',
|
|
30
29
|
description:
|
|
31
|
-
'Maximum number of participants to return. Use -1 for all; otherwise 0–500. Defaults to
|
|
30
|
+
'Maximum number of participants to return. Use -1 for all; otherwise 0–500. Defaults to all (-1).',
|
|
32
31
|
},
|
|
33
32
|
},
|
|
34
33
|
required: ['chatID'],
|
|
@@ -39,8 +38,8 @@ export const tool: Tool = {
|
|
|
39
38
|
};
|
|
40
39
|
|
|
41
40
|
export const handler = async (client: BeeperDesktop, args: Record<string, unknown> | undefined) => {
|
|
42
|
-
const body = args as any;
|
|
43
|
-
return asTextContentResult(await client.chats.retrieve(body));
|
|
41
|
+
const { chatID, ...body } = args as any;
|
|
42
|
+
return asTextContentResult(await client.chats.retrieve(chatID, body));
|
|
44
43
|
};
|
|
45
44
|
|
|
46
45
|
export default { metadata, tool, handler };
|
|
@@ -9,9 +9,9 @@ export const metadata: Metadata = {
|
|
|
9
9
|
resource: 'chats.reminders',
|
|
10
10
|
operation: 'write',
|
|
11
11
|
tags: ['chats'],
|
|
12
|
-
httpMethod: '
|
|
13
|
-
httpPath: '/
|
|
14
|
-
operationId: '
|
|
12
|
+
httpMethod: 'delete',
|
|
13
|
+
httpPath: '/v1/chats/{chatID}/reminders',
|
|
14
|
+
operationId: 'clearChatReminder',
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
export const tool: Tool = {
|
|
@@ -22,18 +22,20 @@ export const tool: Tool = {
|
|
|
22
22
|
properties: {
|
|
23
23
|
chatID: {
|
|
24
24
|
type: 'string',
|
|
25
|
-
description:
|
|
26
|
-
'The identifier of the chat to clear reminder from (accepts both chatID and local chat ID)',
|
|
25
|
+
description: 'Unique identifier of the chat.',
|
|
27
26
|
},
|
|
28
27
|
},
|
|
29
28
|
required: ['chatID'],
|
|
30
29
|
},
|
|
31
|
-
annotations: {
|
|
30
|
+
annotations: {
|
|
31
|
+
idempotentHint: true,
|
|
32
|
+
},
|
|
32
33
|
};
|
|
33
34
|
|
|
34
35
|
export const handler = async (client: BeeperDesktop, args: Record<string, unknown> | undefined) => {
|
|
35
|
-
const body = args as any;
|
|
36
|
-
|
|
36
|
+
const { chatID, ...body } = args as any;
|
|
37
|
+
const response = await client.chats.reminders.delete(chatID).asResponse();
|
|
38
|
+
return asTextContentResult(await response.text());
|
|
37
39
|
};
|
|
38
40
|
|
|
39
41
|
export default { metadata, tool, handler };
|
|
@@ -10,8 +10,8 @@ export const metadata: Metadata = {
|
|
|
10
10
|
operation: 'write',
|
|
11
11
|
tags: ['chats'],
|
|
12
12
|
httpMethod: 'post',
|
|
13
|
-
httpPath: '/
|
|
14
|
-
operationId: '
|
|
13
|
+
httpPath: '/v1/chats/{chatID}/reminders',
|
|
14
|
+
operationId: 'setChatReminder',
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
export const tool: Tool = {
|
|
@@ -22,7 +22,7 @@ export const tool: Tool = {
|
|
|
22
22
|
properties: {
|
|
23
23
|
chatID: {
|
|
24
24
|
type: 'string',
|
|
25
|
-
description: '
|
|
25
|
+
description: 'Unique identifier of the chat.',
|
|
26
26
|
},
|
|
27
27
|
reminder: {
|
|
28
28
|
type: 'object',
|
|
@@ -46,8 +46,9 @@ export const tool: Tool = {
|
|
|
46
46
|
};
|
|
47
47
|
|
|
48
48
|
export const handler = async (client: BeeperDesktop, args: Record<string, unknown> | undefined) => {
|
|
49
|
-
const body = args as any;
|
|
50
|
-
|
|
49
|
+
const { chatID, ...body } = args as any;
|
|
50
|
+
const response = await client.chats.reminders.create(chatID, body).asResponse();
|
|
51
|
+
return asTextContentResult(await response.text());
|
|
51
52
|
};
|
|
52
53
|
|
|
53
54
|
export default { metadata, tool, handler };
|
|
@@ -10,8 +10,8 @@ export const metadata: Metadata = {
|
|
|
10
10
|
operation: 'read',
|
|
11
11
|
tags: ['chats'],
|
|
12
12
|
httpMethod: 'get',
|
|
13
|
-
httpPath: '/
|
|
14
|
-
operationId: '
|
|
13
|
+
httpPath: '/v1/chats/search',
|
|
14
|
+
operationId: 'searchChats',
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
export const tool: Tool = {
|
|
@@ -26,17 +26,17 @@ export const tool: Tool = {
|
|
|
26
26
|
description: 'Provide an array of account IDs to filter chats from specific messaging accounts only',
|
|
27
27
|
items: {
|
|
28
28
|
type: 'string',
|
|
29
|
-
description: '
|
|
29
|
+
description: 'Account ID this resource belongs to.',
|
|
30
30
|
},
|
|
31
31
|
},
|
|
32
32
|
cursor: {
|
|
33
33
|
type: 'string',
|
|
34
|
-
description:
|
|
34
|
+
description: "Opaque pagination cursor; do not inspect. Use together with 'direction'.",
|
|
35
35
|
},
|
|
36
36
|
direction: {
|
|
37
37
|
type: 'string',
|
|
38
38
|
description:
|
|
39
|
-
|
|
39
|
+
"Pagination direction used with 'cursor': 'before' fetches older results, 'after' fetches newer results. Defaults to 'before' when only 'cursor' is provided.",
|
|
40
40
|
enum: ['after', 'before'],
|
|
41
41
|
},
|
|
42
42
|
inbox: {
|
package/src/tools/index.ts
CHANGED
|
@@ -4,14 +4,15 @@ import { Metadata, Endpoint, HandlerFunction } from './types';
|
|
|
4
4
|
|
|
5
5
|
export { Metadata, Endpoint, HandlerFunction };
|
|
6
6
|
|
|
7
|
+
import focus_app from './top-level/focus-app';
|
|
8
|
+
import search from './top-level/search';
|
|
7
9
|
import get_accounts from './accounts/get-accounts';
|
|
8
|
-
import open_in_app from './app/open-in-app';
|
|
9
|
-
import search from './app/search';
|
|
10
10
|
import get_chat from './chats/get-chat';
|
|
11
11
|
import archive_chat from './chats/archive-chat';
|
|
12
12
|
import search_chats from './chats/search-chats';
|
|
13
13
|
import set_chat_reminder from './chats/reminders/set-chat-reminder';
|
|
14
14
|
import clear_chat_reminder from './chats/reminders/clear-chat-reminder';
|
|
15
|
+
import list_messages from './messages/list-messages';
|
|
15
16
|
import search_messages from './messages/search-messages';
|
|
16
17
|
import send_message from './messages/send-message';
|
|
17
18
|
|
|
@@ -21,14 +22,15 @@ function addEndpoint(endpoint: Endpoint) {
|
|
|
21
22
|
endpoints.push(endpoint);
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
addEndpoint(
|
|
25
|
-
addEndpoint(open_in_app);
|
|
25
|
+
addEndpoint(focus_app);
|
|
26
26
|
addEndpoint(search);
|
|
27
|
+
addEndpoint(get_accounts);
|
|
27
28
|
addEndpoint(get_chat);
|
|
28
29
|
addEndpoint(archive_chat);
|
|
29
30
|
addEndpoint(search_chats);
|
|
30
31
|
addEndpoint(set_chat_reminder);
|
|
31
32
|
addEndpoint(clear_chat_reminder);
|
|
33
|
+
addEndpoint(list_messages);
|
|
32
34
|
addEndpoint(search_messages);
|
|
33
35
|
addEndpoint(send_message);
|
|
34
36
|
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { Metadata, asTextContentResult } from '@beeper/desktop-mcp/tools/types';
|
|
4
|
+
|
|
5
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
6
|
+
import BeeperDesktop from '@beeper/desktop-api';
|
|
7
|
+
|
|
8
|
+
export const metadata: Metadata = {
|
|
9
|
+
resource: 'messages',
|
|
10
|
+
operation: 'read',
|
|
11
|
+
tags: ['messages'],
|
|
12
|
+
httpMethod: 'get',
|
|
13
|
+
httpPath: '/v1/chats/{chatID}/messages',
|
|
14
|
+
operationId: 'listMessages',
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const tool: Tool = {
|
|
18
|
+
name: 'list_messages',
|
|
19
|
+
description: 'List messages from a specific chat with pagination support.',
|
|
20
|
+
inputSchema: {
|
|
21
|
+
type: 'object',
|
|
22
|
+
properties: {
|
|
23
|
+
chatID: {
|
|
24
|
+
type: 'string',
|
|
25
|
+
description: 'Unique identifier of the chat.',
|
|
26
|
+
},
|
|
27
|
+
cursor: {
|
|
28
|
+
type: 'string',
|
|
29
|
+
description: "Opaque pagination cursor; do not inspect. Use together with 'direction'.",
|
|
30
|
+
},
|
|
31
|
+
direction: {
|
|
32
|
+
type: 'string',
|
|
33
|
+
description:
|
|
34
|
+
"Pagination direction used with 'cursor': 'before' fetches older results, 'after' fetches newer results. Defaults to 'before' when only 'cursor' is provided.",
|
|
35
|
+
enum: ['after', 'before'],
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
required: ['chatID'],
|
|
39
|
+
},
|
|
40
|
+
annotations: {
|
|
41
|
+
readOnlyHint: true,
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const handler = async (client: BeeperDesktop, args: Record<string, unknown> | undefined) => {
|
|
46
|
+
const { chatID, ...body } = args as any;
|
|
47
|
+
const response = await client.messages.list(chatID, body).asResponse();
|
|
48
|
+
return asTextContentResult(await response.json());
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export default { metadata, tool, handler };
|
|
@@ -10,8 +10,8 @@ export const metadata: Metadata = {
|
|
|
10
10
|
operation: 'read',
|
|
11
11
|
tags: ['messages'],
|
|
12
12
|
httpMethod: 'get',
|
|
13
|
-
httpPath: '/
|
|
14
|
-
operationId: '
|
|
13
|
+
httpPath: '/v1/messages/search',
|
|
14
|
+
operationId: 'searchMessages',
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
export const tool: Tool = {
|
|
@@ -23,15 +23,15 @@ export const tool: Tool = {
|
|
|
23
23
|
properties: {
|
|
24
24
|
accountIDs: {
|
|
25
25
|
type: 'array',
|
|
26
|
-
description: 'Limit search to specific
|
|
26
|
+
description: 'Limit search to specific account IDs.',
|
|
27
27
|
items: {
|
|
28
28
|
type: 'string',
|
|
29
|
-
description: '
|
|
29
|
+
description: 'Account ID this resource belongs to.',
|
|
30
30
|
},
|
|
31
31
|
},
|
|
32
32
|
chatIDs: {
|
|
33
33
|
type: 'array',
|
|
34
|
-
description: 'Limit search to specific
|
|
34
|
+
description: 'Limit search to specific chat IDs.',
|
|
35
35
|
items: {
|
|
36
36
|
type: 'string',
|
|
37
37
|
},
|
|
@@ -75,8 +75,7 @@ export const tool: Tool = {
|
|
|
75
75
|
},
|
|
76
76
|
limit: {
|
|
77
77
|
type: 'integer',
|
|
78
|
-
description:
|
|
79
|
-
'Maximum number of messages to return (1–500). Defaults to 20. The current implementation caps each page at 20 items even if a higher limit is requested.',
|
|
78
|
+
description: 'Maximum number of messages to return.',
|
|
80
79
|
},
|
|
81
80
|
mediaTypes: {
|
|
82
81
|
type: 'array',
|