slack-mcp

slack-mcp

An AWS-native MCP server that posts to Slack (post_to_slack, post_file_to_slack) via an Amazon Bedrock AgentCore Gateway.

Category
访问服务器

README

slack-mcp

An AWS-native MCP server that posts to Slack (post_to_slack, post_file_to_slack), reachable via an Amazon Bedrock AgentCore Gateway.

Today's one caller: daily-tech-brief-bedrock's Bedrock Converse API tool-use loop, replacing its vendored, stdio-spawned copy of a Node.js slack-poster MCP server. This is deliberately scoped to AI callers that decide mid-reasoning to invoke a tool — a packaged automation with no LLM in its trigger path (e.g. a website's deploy/signup notifications) has no use for MCP here and should keep calling a plain Slack incoming webhook instead. See the tool logic's origin and the scope decision in the project's own history for the full reasoning.

Architecture

AWS-internal AI caller (Bedrock Converse tool-use loop, SigV4-signed via
IAM — e.g. mcp-proxy-for-aws's aws_iam_streamablehttp_client)
        |
        v
AgentCore Gateway (authorizer_type = AWS_IAM, protocol_type = MCP)
        |
        v
API Gateway HTTP API (route auth = AWS_IAM, AWS_PROXY integration)
        |
        v
Lambda (container image, Python 3.13) -- FastMCP streamable-HTTP server
wrapped for Lambda via Mangum
        |
        v
Slack Web API (chat.postMessage, using a Bot Token from Secrets Manager)

No VPC Link, ALB, or ECS hop, unlike the sibling CoreSample repo's ec2-audit-mcp (which runs on Fargate) — API Gateway integrates with a Lambda directly, and this tool's actual workload (one outbound HTTPS POST to Slack) doesn't need a always-on container.

Repository layout

server/
  handler.py       Lambda entrypoint: FastMCP app (post_to_slack,
                    post_file_to_slack tools) wrapped for Lambda via Mangum
  slack_tools.py    Pure Slack-posting logic, ported from
                    daily-tech-brief-bedrock's vendored slack_mcp_server/index.js
  Dockerfile
  requirements.txt
terraform/
  lambda.tf           ECR repo, Lambda (container image), IAM execution role
  secrets.tf          Looks up the existing daily-tech-brief-bedrock Slack
                       bot token secret (reused, not duplicated)
  api_gateway.tf       HTTP API, AWS_PROXY integration, AWS_IAM route auth
  agentcore_gateway.tf AgentCore Gateway + target
  deploy_policy.tf     Dedicated deploy IAM user + managed policy, shared
                        by CI's OIDC role (see "Deploy identity" below)
  versions.tf / variables.tf / outputs.tf
tests/               pytest unit tests (mocked Slack API calls, no network)
.github/workflows/test.yml     CI gate: ruff/mypy/pytest + terraform fmt/validate
.github/workflows/deploy.yml   Auto-triggered on push to main

Current status

Live and deployed. Full CI/CD path proven end-to-end: feature branch → PR → passing test CI → merge to main → auto-triggered deploy.yml via GitHub OIDC → terraform apply → image build/push → Lambda update.

  • Lambda: slack-mcp (container image, Python 3.13)
  • API Gateway HTTP API: https://8gr00zm4d9.execute-api.us-west-2.amazonaws.com/
  • AgentCore Gateway: arn:aws:bedrock-agentcore:us-west-2:293528978619:gateway/slack-mcp-cp2plvgahi, target status READY

See CLAUDE.md for the required PR workflow and the deploy-identity/RBAC setup, and the project's vault note for the architecture decisions this was built against (validated directly against CoreSample's deployed-and-verified AgentCore Gateway pattern, not guessed from docs).

Local verification

pip install -r server/requirements.txt -r requirements-dev.txt
ruff check server tests
mypy server
pytest

cd terraform && terraform fmt -check -recursive . && terraform init -backend=false && terraform validate

One-time setup (already done for this stack; kept for reference/re-bootstrap)

  1. Bootstrap the Terraform state bucket (slack-mcp-tfstate-<account-id>), same out-of-band process as CoreSample/daily-tech-brief-bedrock.
  2. No token setup needed — this stack reads the existing daily-tech-brief-bedrock/slack-bot-token Secrets Manager secret rather than provisioning its own.
  3. Bootstrap the deploy identities by hand (deliberately outside Terraform for the OIDC role — see CLAUDE.md "Deploy identity / RBAC"):
    • Create the slack-mcp-deploy IAM user.
    • Create the slack-mcp-github-deploy IAM role with a trust policy scoped to this repo via GitHub's OIDC provider (repository_id condition + wildcard sub match, not a literal repo-name string — see CLAUDE.md for why).
    • Set the AWS_DEPLOY_ROLE_ARN GitHub Actions repo secret to that role's ARN.
  4. terraform init && terraform apply (as the slack-mcp-deploy user) to create the ECR repo and everything else, including aws_iam_policy.deploy and its attachment to both identities from step 3, then build and push the Lambda image (docker build -f server/Dockerfile -t <ecr-repo>:latest . && docker push ...), then terraform apply again so the Lambda's image_uri resolves. From then on, every merge to main re-runs this automatically via .github/workflows/deploy.yml.
  5. Grant the calling project's execution role bedrock-agentcore:InvokeGateway on this stack's agentcore_gateway_arn output.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选