agentmail-mcp 0.1.13 → 0.1.15
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/build/index.js +45 -0
- package/package.json +4 -4
package/build/index.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
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
|
+
});
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentmail-mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.15",
|
|
4
4
|
"description": "AgentMail MCP Server",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
|
-
"agentmail-mcp": "
|
|
7
|
+
"agentmail-mcp": "build/index.js"
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
|
-
"
|
|
10
|
+
"build"
|
|
11
11
|
],
|
|
12
12
|
"scripts": {
|
|
13
|
-
"build": "tsc",
|
|
13
|
+
"build": "tsc && chmod 755 build/index.js",
|
|
14
14
|
"lint": "eslint .",
|
|
15
15
|
"prettier": "prettier --write .",
|
|
16
16
|
"test": "echo \"Error: no test specified\" && exit 1"
|