Skip to content

Conversation

@mishrapravin114
Copy link
Contributor

@mishrapravin114 mishrapravin114 commented Feb 9, 2026

Description

Adds Discord integration enabling agents to list guilds, list channels, send messages, and get recent messages via Discord API v10. Includes 4 MCP tools with full credential store and health check support.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)

Related Issues

Fixes #2913
Related: #2805 (parent integration tools issue)

Changes Made

  • Added discord_tool package with 4 MCP tools for Discord API v10 integration
  • Implemented _DiscordClient class using httpx for HTTP operations
  • Added DiscordHealthChecker for bot token validation before agent execution
  • Added comprehensive test suite with 20 tests covering all operations and error cases
  • Registered Discord tools in main tools/init.py
  • Created DISCORD_CREDENTIALS credential spec with credential store support
  • Created detailed README.md with setup, usage examples, and API reference

Tools implemented:

  • discord_list_guilds - List guilds (servers) the bot is a member of
  • discord_list_channels - List channels for a guild
  • discord_send_message - Send a message to a channel
  • discord_get_messages - Get recent messages from a channel

Testing

  • Unit tests pass (cd tools && pytest tests/tools/test_discord_tool.py tests/test_health_checks.py -v)
  • 20 Discord tests + 44 health check tests passed
  • Lint passes (ruff check on added files)
  • Manual testing performed

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
image image

mishrapravin114 and others added 5 commits February 9, 2026 23:53
- discord_list_guilds: list servers the bot is in
- discord_list_channels: list channels for a guild
- discord_send_message: send message to channel
- discord_get_messages: get recent messages

Auth: DISCORD_BOT_TOKEN, credential spec, health checker.
Uses Discord API v10 (Bot token).

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…ilter

- Rate limit (429): return clear error with retry_after from API
- Message length: validate before send, max 2000 chars per Discord limit
- Channel filter: text_only param (default True) for list_channels
- Add 6 new tests for rate limit, validation, filtering

Co-authored-by: Cursor <cursoragent@cursor.com>
- Retry up to 2 times using Discord's retry_after
- Cap wait at 60s, fallback to exponential backoff if no retry_after
- Add _request_with_retry helper for all API calls
- Add 3 tests: retry then success, retry exhausted, tool-level retry

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Integration]: Discord – channels and messages

1 participant