OpenCode Slack MCP Proxy
A local proxy server that enables Slack MCP integration for opencode by rewriting OAuth-specific endpoints and callback flows. It ensures compatibility between Slack's authentication requirements and opencode's fixed local callback structure.
README
opencode-slack-mcp-proxy
Local TypeScript + Hono facade for Slack MCP that only intercepts the Slack OAuth-specific surfaces it must rewrite, while proxying MCP traffic to Slack and preserving the incoming Slack clientId from opencode requests.
Motivation
Slack MCP is designed to work with Claude Code's OAuth flow. opencode uses a fixed local callback port for OAuth, and Slack MCP does not authenticate correctly against that flow out of the box.
Because of that mismatch, Slack MCP authentication fails in opencode unless the OAuth endpoints and callback flow are adapted. This project acts as a small local proxy that rewrites only the Slack OAuth-specific pieces, keeps the rest of the MCP traffic pointed at Slack, and makes Slack MCP usable from opencode.
Installation
See docs/installation.md for setup, background-run instructions, Docker usage, verification, and troubleshooting.
Useful commands:
pnpm lint
pnpm format
pnpm format:check
pnpm typecheck
pnpm check
pnpm test
pnpm test:all
Source lives in src/, and the main route implementation is in src/app.ts.
For production-style runs, the app can also be compiled to build/ and started with pnpm start.
Optional environment variables:
FACADE_HOST- facade host, default127.0.0.1FACADE_PORTorPORT- facade port, default3120CALLBACK_HOST- callback listener host, default127.0.0.1CALLBACK_PORT- callback port, default3118LOG_LEVEL- pino log level, defaultinfoOPENCODE_HOST- opencode callback host, default127.0.0.1OPENCODE_PORT- opencode callback port, default19876OPENCODE_CALLBACK_PATH- opencode callback path, default/mcp/oauth/callbackREQUEST_TIMEOUT_MS- timeout for Slack and local proxy requests, default10000
All listener hosts are restricted to loopback values (127.0.0.1 or localhost) to avoid exposing the callback bridge on external interfaces.
For containerized runs, listener hosts may also use 0.0.0.0, and OPENCODE_HOST may be set to a reachable host such as host.docker.internal.
opencode config
Use this in place of the remote Slack MCP URL after the local facade is already running:
{
"slack": {
"type": "remote",
"url": "http://127.0.0.1:3120/mcp",
"oauth": {
"clientId": "YOUR_SLACK_CLIENT_ID"
}
}
}
Flow
- opencode connects to the local MCP facade at
http://127.0.0.1:3120/mcp - the facade serves local OAuth discovery metadata
- opencode uses the facade's local authorize and token endpoints
- the authorize endpoint redirects to Slack with
redirect_uri=http://localhost:3118/callback - the callback bridge forwards Slack's callback to
http://127.0.0.1:19876/mcp/oauth/callback - the token endpoint forwards to Slack and forces the same
redirect_uri=http://localhost:3118/callback
Logs
The server logs:
- OAuth discovery responses
- authorize forwarding and rewritten
redirect_uri - token forwarding and rewritten
redirect_uri - Slack token response status and sanitized body
- callback forwarding to opencode
Tests
The unit tests cover the highest-risk rewrite paths:
- authorize redirect rewriting
- token redirect rewriting
- callback proxy failure handling
WWW-Authenticateresource metadata rewriting
Use pnpm test for unit tests and pnpm test:all to run both static checks and tests together.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。