{
  "markdown": "# FieldCure MCP Outbox Server\n\n[![NuGet](https://img.shields.io/nuget/v/FieldCure.Mcp.Outbox)](https://www.nuget.org/packages/FieldCure.Mcp.Outbox)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/fieldcure/fieldcure-mcp-outbox/blob/main/LICENSE)\n\nA multi-channel messaging [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server that sends messages through Slack, Telegram, Email (Gmail, Naver, Microsoft Graph API), KakaoTalk, and Discord. Built with C# and the official [MCP C# SDK](https://github.com/modelcontextprotocol/csharp-sdk).\n\n## Features\n\n- **Multiple messaging channels** — Slack, Telegram, Email (Gmail, Naver, Microsoft Graph API), KakaoTalk, Discord\n- **4 MCP tools** — `list_channels`, `add_channel`, `send_message`, `remove_channel`\n- **Cross-platform credential flow** — runtime secrets can come from env vars or MCP elicitation; OAuth tokens are stored separately for refresh lifecycle\n- **CLI channel setup** — interactive console for browser/OAuth flows where applicable\n- **SMTP presets** — Gmail, Naver with one-command setup\n- **Microsoft Graph API** — OAuth 2.0 browser flow for Outlook / M365 email with automatic token refresh\n- **KakaoTalk OAuth** — localhost callback flow with automatic token refresh\n- **Telegram Client API** — send to Saved Messages via WTelegramClient\n- **Stdio transport** — standard MCP subprocess model via JSON-RPC over stdin/stdout\n\n## Why Outbox?\n\nExisting MCP servers are channel-specific — one for Slack, another for Gmail, yet another for Telegram. Each requires separate installation, configuration, and the LLM must know which tool to call for each channel.\n\nOutbox takes a different approach:\n\n- **One tool, multiple channels** — `send_message` abstracts away channel differences. The LLM doesn't need to know Slack API vs SMTP vs Kakao REST.\n- **Credential isolation** — OAuth refresh tokens live in `tokens.json` with current-user-only file permissions; MCP tool flows can resolve secrets at runtime via env vars or elicitation.\n- **Single install** — `dotnet tool install -g` gives you 4 channels. No need to install and configure separate servers per channel.\n- **KakaoTalk support** — Currently the only MCP server with KakaoTalk messaging, essential for Korean users.\n\n## Installation\n\n### dotnet tool (recommended)\n\n```bash\ndotnet tool install -g FieldCure.Mcp.Outbox\n```\n\nAfter installation, the `fieldcure-mcp-outbox` command is available globally.\n\n### From source\n\n```bash\ngit clone https://github.com/fieldcure/fieldcure-mcp-outbox.git\ncd fieldcure-mcp-outbox\ndotnet build\n```\n\n## Requirements\n\n- [.NET 8.0 Runtime](https://dotnet.microsoft.com/download/dotnet/8.0) or later\n- Cross-platform (Windows, Linux, macOS)\n\n## Configuration\n\n### Claude Desktop\n\nAdd to `claude_desktop_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"outbox\": {\n      \"command\": \"fieldcure-mcp-outbox\"\n    }\n  }\n}\n```\n\n### VS Code (Copilot)\n\nAdd to `.vscode/mcp.json`:\n\n```json\n{\n  \"servers\": {\n    \"outbox\": {\n      \"command\": \"fieldcure-mcp-outbox\"\n    }\n  }\n}\n```\n\n### From source (without dotnet tool)\n\n```json\n{\n  \"mcpServers\": {\n    \"outbox\": {\n      \"command\": \"dotnet\",\n      \"args\": [\n        \"run\",\n        \"--project\", \"C:\\\\path\\\\to\\\\fieldcure-mcp-outbox\\\\src\\\\FieldCure.Mcp.Outbox\"\n      ]\n    }\n  }\n}\n```\n\n## Tools\n\n| Tool | Description | Confirmation |\n|------|-------------|:------------:|\n| `list_channels` | List all configured messaging channels | — |\n| `add_channel` | Add a new channel (MCP elicitation for all channel types; Microsoft/KakaoTalk require a local browser on the MCP host) | — |\n| `send_message` | Send a message through a configured channel | Required |\n| `remove_channel` | Remove a channel and its stored credentials | Required |\n\n## Channels\n\nOAuth tokens for Microsoft/KakaoTalk are stored in `tokens.json` so the server can refresh them across runs (current-user-only file permissions — Windows ACL / Unix `0600`).\n\nStatic secrets (Slack bot tokens, Discord webhook URLs, SMTP passwords, etc.) resolve at send time in this order: in-memory cache → env var `OUTBOX_{CHANNEL_ID}_{FIELD}` → plaintext in `channels.json` → MCP elicitation. The CLI `add_channel` flow writes directly into `channels.json` for a zero-configuration local experience. This is an intentional local-trust choice with the same same-user boundary as `tokens.json`, documented in [ADR-001](https://github.com/fieldcure/fieldcure-assiststudio/blob/main/docs/ADR-001-MCP-Credential-Management.md) Principle 2. For shared hosts, CI, or headless deployments, set the env vars explicitly and leave `channels.json` secret fields empty.\n\n| Channel | Protocol | Setup |\n|---------|----------|-------|\n| Slack | Web API (`chat.postMessage`) | [Guide](docs/setup-slack.md) |\n| Telegram | Client API (WTelegramClient) | [Guide](docs/setup-telegram.md) |\n| Gmail | SMTP | [Guide](docs/setup-gmail.md) |\n| Naver | SMTP | [Guide](docs/setup-naver.md) |\n| Microsoft | Graph API (`/me/sendMail`) | [Guide](docs/setup-microsoft.md) |\n| KakaoTalk | Kakao REST API | [Guide](docs/setup-kakaotalk.md) |\n| Discord | Webhook API | [Guide](docs/setup-discord.md) |\n| Custom SMTP | User-defined | [Guide](docs/setup-custom-smtp.md) |\n\n### Static Secret Environment Variables\n\nWhen a channel requires a static secret at send time, Outbox looks for an environment variable named:\n\n```text\nOUTBOX_<CHANNEL_ID>_<FIELD>\n```\n\nExamples:\n\n- `OUTBOX_MICROSOFT_1_CLIENT_SECRET`\n- `OUTBOX_KAKAOTALK_1_API_KEY`\n- `OUTBOX_KAKAOTALK_1_CLIENT_SECRET`\n- `OUTBOX_SMTP_GMAIL_1_PASSWORD`\n\nIf the variable is unset and the MCP client supports elicitation, Outbox prompts for it interactively and caches it for the current session.\n\n## CLI Commands\n\n```bash\nfieldcure-mcp-outbox                      # Start MCP server (stdio)\nfieldcure-mcp-outbox add slack            # Add Slack channel\nfieldcure-mcp-outbox add telegram         # Add Telegram channel\nfieldcure-mcp-outbox add gmail            # Add Gmail SMTP channel\nfieldcure-mcp-outbox add naver            # Add Naver SMTP channel\nfieldcure-mcp-outbox add smtp             # Add custom SMTP channel\nfieldcure-mcp-outbox add microsoft        # Add Microsoft (Outlook/M365) channel\nfieldcure-mcp-outbox add kakaotalk        # Add KakaoTalk channel\nfieldcure-mcp-outbox add discord          # Add Discord channel\nfieldcure-mcp-outbox list                 # List configured channels\nfieldcure-mcp-outbox remove <id>          # Remove a channel\n```\n\n## Data Storage\n\n| Data | Location |\n|------|----------|\n| Channel metadata | `%LOCALAPPDATA%\\FieldCure\\Mcp.Outbox\\channels.json` |\n| OAuth tokens | `%LOCALAPPDATA%\\FieldCure\\Mcp.Outbox\\tokens.json` |\n| Telegram sessions | `%LOCALAPPDATA%\\FieldCure\\Mcp.Outbox\\sessions\\` |\n\n`tokens.json` is stored in plain JSON and protected by filesystem permissions:\n\n- Windows: ACL restricted to the current user\n- Linux/macOS: mode `0600`\n\nThis protects against other local users on the same machine, but not against compromise of the same OS user account.\n\n## Project Structure\n\n```\nsrc/FieldCure.Mcp.Outbox/\n├── Program.cs                  # Entry point: MCP server vs CLI branching\n├── Channels/\n│   ├── IChannel.cs             # Channel interface + SendRequest/SendResult\n│   ├── ChannelFactory.cs       # Channel instantiation by type\n│   ├── SlackChannel.cs         # Slack Web API\n│   ├── TelegramChannel.cs      # WTelegramClient\n│   ├── SmtpChannel.cs          # MailKit SMTP\n│   ├── MicrosoftChannel.cs     # Microsoft Graph API\n│   ├── KakaoTalkChannel.cs     # Kakao REST API\n│   └── DiscordChannel.cs       # Discord Webhook API\n├── Tools/\n│   ├── ListChannelsTool.cs     # list_channels\n│   ├── AddChannelTool.cs       # add_channel (elicitation + browser OAuth for Kakao/Microsoft)\n│   ├── RemoveChannelTool.cs    # remove_channel\n│   └── SendMessageTool.cs      # send_message\n├── Interaction/\n│   ├── IElicitGate.cs          # Minimal MCP elicitation surface for tests\n│   └── McpServerElicitGate.cs  # Production adapter around McpServer\n├── OAuth/\n│   └── BrowserOAuthFlow.cs     # Localhost callback + Process.Start + elicit race (MCP and CLI entry points)\n├── Credentials/\n│   └── OutboxSecretResolver.cs # cache → env → channels.json → elicitation\n├── Setup/\n│   ├── SetupRunner.cs          # CLI router (diagnostic path)\n│   ├── ConsoleHelper.cs        # Masked input, prompts\n│   ├── SlackSetup.cs\n│   ├── TelegramSetup.cs\n│   ├── SmtpSetup.cs\n│   ├── MicrosoftSetup.cs\n│   ├── KakaoTalkSetup.cs\n│   └── DiscordSetup.cs\n└── Configuration/\n    ├── ChannelStore.cs         # channels.json persistence (metadata + static-secret fallback)\n    ├── OAuthTokenStore.cs      # tokens.json persistence (OAuth access/refresh, user-only file perms)\n    └── SmtpPresets.cs          # SMTP preset definitions\n```\n\n## Development\n\n```bash\n# Build\ndotnet build\n\n# Test\ndotnet test\n\n# Pack as dotnet tool\ndotnet pack src/FieldCure.Mcp.Outbox -c Release\n```\n\n## See Also\n\nPart of the [AssistStudio ecosystem](https://github.com/fieldcure/fieldcure-assiststudio#packages).\n\n## License\n\n[MIT](LICENSE)\n",
  "bytes": 9069,
  "sha": "1402b17c9c14a3f5e05b80f3e5c1e76746a6442c00ee01645014407d5ded2a67",
  "repo_slug": "fieldcure/fieldcure-mcp-outbox",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_fieldcure_outbox_d3101f8d/readme"
}