agentmail-mcp 0.1.10 → 0.1.12
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/package.json +2 -2
- package/dist/index.js +0 -45
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentmail-mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.12",
|
|
4
4
|
"description": "AgentMail MCP Server",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -36,6 +36,6 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@modelcontextprotocol/sdk": "^1.24.1",
|
|
38
38
|
"agentmail": "^0.1.8",
|
|
39
|
-
"agentmail-toolkit": "^0.1.
|
|
39
|
+
"agentmail-toolkit": "^0.1.33"
|
|
40
40
|
}
|
|
41
41
|
}
|
package/dist/index.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { AgentMailClient, AgentMailEnvironment } from 'agentmail';
|
|
3
|
-
import { AgentMailToolkit } from 'agentmail-toolkit/mcp';
|
|
4
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
5
|
-
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
6
|
-
const parseToolsArg = () => {
|
|
7
|
-
const args = process.argv.slice(2);
|
|
8
|
-
const toolsIndex = args.indexOf('--tools');
|
|
9
|
-
if (toolsIndex === -1)
|
|
10
|
-
return undefined;
|
|
11
|
-
const toolsArg = args[toolsIndex + 1];
|
|
12
|
-
if (!toolsArg) {
|
|
13
|
-
console.error('Error: --tools flag requires a comma-separated list of tool names');
|
|
14
|
-
process.exit(1);
|
|
15
|
-
}
|
|
16
|
-
return toolsArg.split(',').map((tool) => tool.trim());
|
|
17
|
-
};
|
|
18
|
-
const parseAgentMailEnv = () => {
|
|
19
|
-
const env = process.env.AGENTMAIL_ENVIRONMENT?.toLowerCase();
|
|
20
|
-
switch (env) {
|
|
21
|
-
case 'development':
|
|
22
|
-
case 'dev':
|
|
23
|
-
return AgentMailEnvironment.Development;
|
|
24
|
-
case 'production':
|
|
25
|
-
case 'prod':
|
|
26
|
-
default:
|
|
27
|
-
return AgentMailEnvironment.Production;
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
const main = async () => {
|
|
31
|
-
const environment = parseAgentMailEnv();
|
|
32
|
-
const toolNames = parseToolsArg();
|
|
33
|
-
const client = new AgentMailClient({ environment });
|
|
34
|
-
const toolkit = new AgentMailToolkit(client);
|
|
35
|
-
const server = new McpServer({ name: 'AgentMail', version: '0.1.0' });
|
|
36
|
-
const transport = new StdioServerTransport();
|
|
37
|
-
for (const tool of toolkit.getTools(toolNames)) {
|
|
38
|
-
server.registerTool(tool.name, { description: tool.description, inputSchema: tool.paramsSchema }, tool.callback);
|
|
39
|
-
}
|
|
40
|
-
await server.connect(transport);
|
|
41
|
-
};
|
|
42
|
-
main().catch((error) => {
|
|
43
|
-
console.error(error);
|
|
44
|
-
process.exit(1);
|
|
45
|
-
});
|