agentmail-mcp 0.1.5 → 0.1.7
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 +20 -0
- package/dist/index.js +33 -4
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -23,3 +23,23 @@ Get your API key from [AgentMail](https://agentmail.to)
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
```
|
|
26
|
+
|
|
27
|
+
## Tool Selection
|
|
28
|
+
|
|
29
|
+
By default, all available tools are loaded. You can selectively enable specific tools using the `--tools` argument with a comma-separated list of tool names.
|
|
30
|
+
|
|
31
|
+
### Example
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"mcpServers": {
|
|
36
|
+
"AgentMail": {
|
|
37
|
+
"command": "npx",
|
|
38
|
+
"args": ["-y", "agentmail-mcp", "--tools", "get_message,send_message,reply_to_message"],
|
|
39
|
+
"env": {
|
|
40
|
+
"AGENTMAIL_API_KEY": "YOUR_API_KEY"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
```
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,44 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { AgentMailClient, AgentMailEnvironment } from 'agentmail';
|
|
3
|
+
import { AgentMailToolkit } from 'agentmail-toolkit/mcp';
|
|
2
4
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
5
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
|
-
|
|
5
|
-
|
|
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);
|
|
6
35
|
const server = new McpServer({ name: 'AgentMail', version: '0.1.0' });
|
|
7
36
|
const transport = new StdioServerTransport();
|
|
8
|
-
for (const tool of
|
|
37
|
+
for (const tool of toolkit.getTools(toolNames)) {
|
|
9
38
|
server.tool(tool.name, tool.description, tool.paramsSchema, tool.callback);
|
|
10
39
|
}
|
|
11
40
|
await server.connect(transport);
|
|
12
|
-
}
|
|
41
|
+
};
|
|
13
42
|
main().catch((error) => {
|
|
14
43
|
console.error(error);
|
|
15
44
|
process.exit(1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentmail-mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "AgentMail MCP Server",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
38
|
-
"agentmail
|
|
38
|
+
"agentmail": "^0.0.34",
|
|
39
|
+
"agentmail-toolkit": "^0.1.24"
|
|
39
40
|
}
|
|
40
41
|
}
|