A Dart-based example server for handling email operations using MCP (Model Context Protocol).
- Send emails
- MCP protocol support
- Example server implementation
- I used Ethereal a fake SMTP service or use can use your own SMTP Email and Password.
-
Clone the repository:
git clone https://github.com/yourusername/email_dart_mcp_server_example.git cd email_dart_mcp_server_example -
Install dependencies:
dart pub get
- Configure email settings in the appropriate configuration file or environment variables. Replace values as needed.
final smtpServer = SmtpServer(
'smtp.ethereal.email',
username: 'username',
password: 'password',
port: 587,
);
final message = Message()
..from = Address('from-email', 'MCP Server')
..recipients.add(to)
..subject = subject
..text = content;
- Go to IDE MCP and Integration Settings
- Add this JSON, change file path acc. to ur system
{
"mcpServers": {
"Dart MCP Server": {
"command": "dart",
"args": [
"run",
"C:\\Users\\Navoki\\AndroidStudioProjects\\email_dart_mcp_server_example\\bin\\email_dart_mcp_server_example.dart"
]
}
}
}
- Send prompt
Test and send email with dummy content and subject to abc@abc.com
- Run this command in Terminal to launch MCP Inspector
npx @modelcontextprotocol/inspector - Command:
dart - Arguments:
run "C:\Users\Navoki\AndroidStudioProjects\mcp_flutter_dart_example\mcp_server_dart_example\bin\mcp_server_dart_example.dart" - Click 'Connect'
bin/- Main entry point for the serverlib/- Core library code
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License.