{"id":18029,"library":"agentmail-mcp","title":"AgentMail MCP Server Tools","description":"The `agentmail-mcp` package provides the Message Control Protocol (MCP) server, offering command-line tools for interacting with the AgentMail API. It enables users to expose AgentMail functionalities, such as sending, receiving, and replying to messages, as tools accessible by other applications or AI agents. Currently at version 0.2.2, this package is in an early development phase, likely receiving updates as the AgentMail platform evolves. Its core differentiator is simplifying the integration of AgentMail's messaging capabilities into automated workflows or agent-based systems by abstracting API calls into runnable commands. The release cadence is probably tied to AgentMail platform updates rather than a fixed schedule. It serves as a bridge, allowing external systems to leverage AgentMail's messaging features without complex direct API integrations.","status":"active","version":"0.2.2","language":"javascript","source_language":"en","source_url":"https://github.com/agentmail-to/agentmail-mcp","tags":["javascript","agentmail","mcp","server","tools"],"install":[{"cmd":"npm install agentmail-mcp","lang":"bash","label":"npm"},{"cmd":"yarn add agentmail-mcp","lang":"bash","label":"yarn"},{"cmd":"pnpm add agentmail-mcp","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package is primarily designed as a command-line utility, executed via `npx` to spawn the MCP server. Its main functionality is accessed through command-line arguments and environment variables.","symbol":"agentmail-mcp (CLI invocation)","correct":"npx agentmail-mcp --tools get_message,send_message"},{"note":"The API key for authentication is passed via the `AGENTMAIL_API_KEY` environment variable, not set programmatically through a library export.","wrong":"import { setApiKey } from 'agentmail-mcp'","symbol":"AgentMail API Key (Environment variable)","correct":"export AGENTMAIL_API_KEY=\"YOUR_API_KEY_HERE\""},{"note":"Attempting to `require()` or `import` this package for programmatic library use is discouraged as its primary interface is the command line. The package's internal API is not exposed for stable, direct programmatic consumption.","wrong":"const mcp = require('agentmail-mcp');\n// OR\nimport agentmailMcp from 'agentmail-mcp';","symbol":"Programmatic Import (CommonJS/ESM)","correct":null}],"quickstart":{"code":"// To run the AgentMail MCP server with selected tools from your terminal:\n// Make sure to replace YOUR_AGENTMAIL_API_KEY with your actual key.\nconst AGENTMAIL_API_KEY = process.env.AGENTMAIL_API_KEY ?? 'YOUR_AGENTMAIL_API_KEY';\n\nif (AGENTMAIL_API_KEY === 'YOUR_AGENTMAIL_API_KEY') {\n  console.error('Error: AGENTMAIL_API_KEY environment variable is not set. Please set your AgentMail API key.');\n  process.exit(1);\n}\n\n// Example using the shell command:\nconsole.log('Execute this command in your terminal:');\nconsole.log(`AGENTMAIL_API_KEY=\"${AGENTMAIL_API_KEY}\" npx -y agentmail-mcp --tools get_message,send_message,reply_to_message`);\n\n// For integration into a system that consumes a JSON configuration (as shown in README):\nconst mcpConfiguration = {\n    \"mcpServers\": {\n        \"AgentMail\": {\n            \"command\": \"npx\",\n            \"args\": [\"-y\", \"agentmail-mcp\", \"--tools\", \"get_message,send_message,reply_to_message\"],\n            \"env\": {\n                \"AGENTMAIL_API_KEY\": AGENTMAIL_API_KEY\n            }\n        }\n    }\n};\n\nconsole.log('\\nOr, for integration with a system that uses a structured configuration:');\nconsole.log(JSON.stringify(mcpConfiguration, null, 2));","lang":"javascript","description":"Demonstrates how to run the AgentMail MCP server as a command-line tool using `npx`, enabling specific AgentMail tools and passing the API key via an environment variable."},"warnings":[{"fix":"Pin to exact versions in production environments and thoroughly test updates. Monitor the GitHub repository for release notes.","message":"As a package in early development (version 0.x.y), its API, command-line arguments, and available tools are subject to frequent breaking changes without adhering strictly to semantic versioning. Always consult the latest README.","severity":"breaking","affected_versions":">=0.0.1"},{"fix":"Always set `AGENTMAIL_API_KEY` as an environment variable (e.g., `export AGENTMAIL_API_KEY=...` or use a `.env` file) before running the `npx agentmail-mcp` command.","message":"The `AGENTMAIL_API_KEY` is crucial for authentication. Failing to set it correctly as an environment variable will prevent the server from functioning. Do not hardcode API keys directly in source code.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Refer to the AgentMail API documentation or the `agentmail-mcp` source (if available) for the exact list of supported tool names. Ensure they are comma-separated without extra spaces.","message":"Tool names specified with `--tools` must exactly match the available tools provided by the AgentMail API. Supplying incorrect or misspelled tool names will result in those tools not being loaded or errors during runtime.","severity":"gotcha","affected_versions":">=0.0.1"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Set the environment variable before running the command: `AGENTMAIL_API_KEY=\"YOUR_API_KEY\" npx agentmail-mcp ...`","cause":"The required `AGENTMAIL_API_KEY` environment variable was not supplied when invoking `agentmail-mcp`.","error":"Error: AGENTMAIL_API_KEY is not set. Please provide your AgentMail API key."},{"fix":"Check the spelling and case of the tool names. Use a comma-separated list of valid tool names, for example: `--tools get_message,send_message`.","cause":"One or more tool names provided to the `--tools` argument do not match the expected names.","error":"Error: Invalid tool name 'typo_in_tool'. Available tools are: get_message, send_message..."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}