Stack exchange MCP for AI Agents

Securely connect your AI agents and chatbots (Claude, ChatGPT, Cursor, etc) with Stack exchange MCP or direct API to search questions, post answers, fetch user activity, and manage content across Stack Overflow and other communities through natural language.
Trusted by
AWS
Glean
Zoom
Airtable

30 min · no commitment · see it on your stack

Stack exchange Logo
Gradient Top
Gradient Middle
Gradient Bottom
divider

Try Stack exchange now

Enter a prompt below to test the integration in our Tool Router playground. You'll be redirected to sign in and try it live.

Supported Tools

Tools
Create FilterTool to create a custom filter for Stack Exchange API responses.
Find Similar QuestionsTool to find questions similar to a hypothetical one based on a title and optional tag combination.
Get Access TokensTool to read the properties for a set of access tokens obtained via OAuth 2.
Get Answer CommentsTool to retrieve comments on a set of answers from Stack Exchange.
Get Answer Flag OptionsTool to fetch valid flag options for a specific answer.
Get Answers By IDsTool to retrieve a set of answers by their IDs from a Stack Exchange site.
Get Badge Recipients By IDsTool to retrieve recently awarded badges constrained to a specific set of badge IDs.
Get Badges By IDsTool to retrieve badges by their IDs on a Stack Exchange site.
Get Collective AnswersTool to retrieve answers belonging to the specified collective(s) on a Stack Exchange site.
Get Collective QuestionsTool to retrieve questions associated with the specified collective.
Get CollectivesTool to retrieve all collectives on a Stack Exchange site in alphabetical order.
Get Collectives By SlugsTool to retrieve Collective objects by their slugs from a Stack Exchange site.
Get Collective TagsRetrieve tags associated with specified Stack Overflow collectives.
Get Collective UsersTool to retrieve users who are members of the specified Collectives on Stack Exchange.
Get Comment Flag OptionsTool to fetch valid flag options for a given comment.
Get CommentsRetrieves comments from a Stack Exchange site (e.
Get Comments By IDsTool to retrieve specific comments by their IDs from a Stack Exchange site.
Get EventsRetrieves a stream of recent events that occurred on a Stack Exchange site.
Get Filters By IDsTool to retrieve the fields included by the given filters and the safeness of those filters.
Get Linked QuestionsTool to get questions which link to those questions identified in the ids parameter.
Get MeTool to retrieve the authenticated user's profile information from Stack Exchange.
Get My AchievementsRetrieves the authenticated user's recent network-wide achievements across all Stack Exchange sites.
Get My Associated AccountsTool to retrieve all Stack Exchange accounts associated with the authenticated user.
Get My Featured QuestionsTool to retrieve questions with active bounties offered by the authenticated user.
Get My MentionsTool to retrieve comments mentioning the authenticated user on a Stack Exchange site.
Get My Merge HistoryTool to retrieve account merge history for the authenticated user.
Get My Network ActivityTool to retrieve a summary of the authenticated user's activity across the Stack Exchange network.
Get My No Answer QuestionsTool to retrieve questions owned by the authenticated user that have no answers.
Get My PostsTool to retrieve posts (questions and answers) owned by the authenticated user from a Stack Exchange site.
Get My PrivilegesTool to retrieve privileges for the authenticated user on a Stack Exchange site.
Get My QuestionsTool to retrieve questions owned by the authenticated user on a Stack Exchange site.
Get My ReputationTool to retrieve reputation changes for the authenticated user on a Stack Exchange site.
Get My Reputation HistoryTool to retrieve the authenticated user's public reputation history on a Stack Exchange site.
Get My Suggested EditsTool to retrieve suggested edits submitted by the authenticated user on a Stack Exchange site.
Get My Tag PreferencesTool to retrieve tag preferences for the authenticated user on a Stack Exchange site.
Get My TagsTool to retrieve tags the authenticated user is active in on a Stack Exchange site.
Get My TimelineTool to retrieve a timeline of actions the authenticated user has taken on a Stack Exchange site.
Get My Top Answers In TagsTool to retrieve the top 30 answers the authenticated user has posted in response to questions with specific tags.
Get My Top Answer TagsTool to retrieve the authenticated user's top 30 tags by answer score on a Stack Exchange site.
Get My Top Questions In TagsTool to retrieve the top 30 questions the authenticated user has posted in response to questions with the given tags.
Get My Top Question TagsTool to retrieve the authenticated user's top 30 tags by question score on a Stack Exchange site.
Get My Top TagsTool to retrieve the authenticated user's top 30 tags by combined question and answer score on a Stack Exchange site.
Get My Unaccepted QuestionsTool to retrieve questions owned by the authenticated user that have no accepted answer.
Get My Unanswered QuestionsTool to retrieve questions owned by the authenticated user that are not considered answered.
Get Post CommentsTool to retrieve comments on posts identified by IDs, regardless of post type (question or answer).
Get Posts By IDsTool to retrieve a set of posts by their IDs from a Stack Exchange site.
Get Post Suggested EditsTool to retrieve suggested edits on posts from a Stack Exchange site.
Get Question AnswersTool to retrieve all answers for a set of questions identified by their IDs.
Get Question Close OptionsTool to fetch flag options that make up close reasons for a specific question.
Get Question CommentsTool to retrieve comments on a set of questions from Stack Exchange.
Get Question Flag OptionsTool to fetch valid flag options, including close reasons, for a specific question.
Get QuestionsTool to retrieve a list of questions from a Stack Exchange site without requiring tags or keywords.
Get Questions By Answer IDsTool to retrieve questions that specific answers belong to on a Stack Exchange site.
Get Questions By IDsTool to retrieve a set of questions by their IDs from a Stack Exchange site.
Get Question TimelineTool to retrieve timeline events for specified questions on a Stack Exchange site.
Get Related TagsTool to retrieve tags most related to the specified tags on a Stack Exchange site.
Get Revisions By IDsTool to retrieve revisions for specific posts by their IDs.
Search QuestionsTool to search the site for questions meeting certain criteria.
Get Site InfoTool to retrieve comprehensive statistics and information about a Stack Exchange site.
Get SitesRetrieves a comprehensive list of all Stack Exchange network sites with detailed information including site names, URLs, styling, and api_site_parameter values needed for other API calls.
Get Suggested Edits By IDsTool to retrieve suggested edits by their IDs from a Stack Exchange site.
Get Tag FAQTool to retrieve frequently asked questions for a set of tags on Stack Exchange.
Get Tag InfoTool to retrieve tag objects representing specified tags on a Stack Exchange site.
Get Tag SynonymsTool to retrieve all synonyms that point to the specified tags on a Stack Exchange site.
Get Tag Top AnswerersTool to retrieve the top 30 answerers active in a single tag, of either all-time or the last 30 days.
Get Tag Top AskersTool to retrieve the top askers active in a single tag.
Get Tag WikisTool to retrieve wiki content for specified tags on a Stack Exchange site.
Get User AnswersTool to retrieve answers posted by specific users on a Stack Exchange site.
Get User Associated AccountsTool to retrieve all Stack Exchange accounts associated with specified users by their account IDs.
Get User BadgesTool to retrieve badges earned by specified users on a Stack Exchange site.
Get User CommentsTool to retrieve comments posted by specified users on a Stack Exchange site.
Get User Comments To UserTool to retrieve comments that specific users have posted in reply to a single user.
Get User FavoritesTool to retrieve the questions that users have favorited/bookmarked.
Get User Featured QuestionsTool to retrieve questions with active bounties offered by specified users.
Get User Full Reputation HistoryTool to retrieve a user's full reputation history on a Stack Exchange site, including private events.
Get User InboxTool to retrieve a user's inbox from Stack Exchange.
Get User MentionsTool to retrieve comments that mention specific users on a Stack Exchange site.
Get User Merge HistoryTool to retrieve account merge history for specified user account IDs across the Stack Exchange network.
Get User No Answer QuestionsTool to retrieve questions asked by specified users that have zero undeleted answers.
Get User NotificationsTool to retrieve notifications for a specific Stack Exchange user by ID.
Get User PostsTool to retrieve posts (questions and answers) posted by specific users on a Stack Exchange site.
Get User PrivilegesTool to retrieve privileges a specific user has on a Stack Exchange site.
Get User QuestionsTool to retrieve questions asked by specific users on a Stack Exchange site.
Get User ReputationTool to retrieve reputation changes for users on a Stack Exchange site.
Get User Reputation HistoryTool to retrieve public reputation history for specified Stack Exchange users.
Get Users By IDsTool to retrieve user profiles by their IDs from a Stack Exchange site.
Get User Suggested EditsTool to retrieve suggested edits submitted by specified users on a Stack Exchange site.
Get User TagsTool to retrieve tags that specified users are active in on a Stack Exchange site.
Get User TimelineTool to retrieve a timeline of actions taken by specified users on a Stack Exchange site.
Get User Top Answers In TagsTool to retrieve the top 30 answers a specific user has posted in response to questions with given tags.
Get User Top Answer TagsTool to retrieve a single user's top tags by answer score on Stack Exchange.
Get User Top Questions In TagsTool to retrieve the top 30 questions a user has asked with the given tags.
Get User Top Question TagsTool to retrieve a single user's top tags by question score on a Stack Exchange site.
Get User Top TagsTool to retrieve a single user's top tags by combined question and answer score on a Stack Exchange site.
Get User Unaccepted QuestionsTool to retrieve questions asked by specified users that have at least one answer but no accepted answer.
Get User Unanswered QuestionsTool to retrieve questions asked by specific users that the site considers unanswered.
Get User Unread InboxTool to retrieve unread items in a specific user's Stack Exchange inbox.
Get User Unread NotificationsTool to retrieve unread notifications for a specific user on Stack Exchange.
List AnswersTool to retrieve all undeleted answers from a Stack Exchange site.
List Badge RecipientsTool to retrieve recently awarded badges from a Stack Exchange site.
List BadgesTool to retrieve all badges available in a Stack Exchange site.
List Elected ModeratorsTool to retrieve users who have moderator powers and were actually elected on a Stack Exchange site.
List ErrorsTool to retrieve the various error codes that can be produced by the Stack Exchange API.
List Featured QuestionsTool to retrieve all questions with active bounties in the system.
List Moderator Only TagsTool to retrieve tags that only moderators can use on a Stack Exchange site.
List ModeratorsTool to retrieve users who can exercise moderation powers on a Stack Exchange site.
List Named BadgesTool to retrieve all explicitly named badges from a Stack Exchange site.
List No Answer QuestionsTool to retrieve questions that have received no answers from a Stack Exchange site.
List PostsTool to retrieve all posts (questions and answers) from a Stack Exchange site.
List PrivilegesTool to retrieve all earnable privileges on a Stack Exchange site.
List Required TagsTool to retrieve tags found on a site that fulfill required tag constraints on questions.
List Suggested EditsTool to retrieve all suggested edits in a Stack Exchange site.
List Tag BadgesReturns badges awarded for participation in specific tags on Stack Exchange sites.
List TagsTool to retrieve tags found on a Stack Exchange site.
List Tag SynonymsTool to retrieve all tag synonyms found on a Stack Exchange site.
List Unanswered QuestionsTool to retrieve questions the site considers to be unanswered.
List Unanswered Questions My TagsTool to retrieve unanswered questions within the authenticated user's favorite or frequented tags.
List UsersTool to retrieve all users on a Stack Exchange site.
Render AnswerTool to render a preview of an answer given its body and the question it's on.
Advanced SearchTool to search a Stack Exchange site for questions matching advanced criteria.
Search ExcerptsTool to search a Stack Exchange site for items matching given criteria with excerpt snippets.
Python
TypeScript

Install Composio

python
pip install composio claude-agent-sdk
Install the Composio SDK and Claude Agent SDK

Create Tool Router Session

python
from composio import Composio
from claude_agent_sdk import ClaudeSDKClient, ClaudeAgentOptions

composio = Composio(api_key='your-composio-api-key')
session = composio.create(user_id='your-user-id')
url = session.mcp.url
Initialize the Composio client and create a Tool Router session

Connect to AI Agent

python
import asyncio

options = ClaudeAgentOptions(
    permission_mode='bypassPermissions',
    mcp_servers={
        'tool_router': {
            'type': 'http',
            'url': url,
            'headers': {
                'x-api-key': 'your-composio-api-key'
            }
        }
    },
    system_prompt='You are a helpful assistant with access to Stack exchange tools.',
    max_turns=10
)

async def main():
    async with ClaudeSDKClient(options=options) as client:
        await client.query('Search questions tagged python about async io')
        async for message in client.receive_response():
            if hasattr(message, 'content'):
                for block in message.content:
                    if hasattr(block, 'text'):
                        print(block.text)

asyncio.run(main())
Use the MCP server with your AI agent

Why Use Composio?

AI Native Stack exchange Integration

  • Supports both Stack exchange MCP and direct API based integrations
  • Structured, LLM-friendly schemas for reliable tool execution
  • Rich coverage for searching, posting, and managing Q&A content

Managed Auth

  • Built-in OAuth handling with automatic token refresh and rotation
  • Central place to manage, scope, and revoke Stack exchange access
  • Per user and per environment credentials instead of hard-coded keys

Agent Optimized Design

  • Tools are tuned using real error and success rates to improve reliability over time
  • Comprehensive execution logs so you always know what ran, when, and on whose behalf

Enterprise Grade Security

  • Fine-grained RBAC so you control which agents and users can access Stack exchange
  • Scoped, least privilege access to Stack exchange resources
  • Full audit trail of agent actions to support review and compliance

Frequently Asked Questions

Do I need my own developer credentials to use Stack exchange with Composio?

No, you can get started immediately using Composio's built-in Stack exchange app. For production, we recommend configuring your own OAuth credentials.

Can I use multiple toolkits together?

Yes! Composio's Tool Router enables agents to use multiple toolkits. Learn more.

Is Composio secure?

Composio is SOC 2 and ISO 27001 compliant with all data encrypted in transit and at rest. Learn more.

What if the API changes?

Composio maintains and updates all toolkit integrations automatically, so your agents always work with the latest API versions.

Used by agents from

Context
Letta
glean
HubSpot
Agent.ai
Altera
DataStax
Entelligence
Rolai
Context
Letta
glean
HubSpot
Agent.ai
Altera
DataStax
Entelligence
Rolai
Context
Letta
glean
HubSpot
Agent.ai
Altera
DataStax
Entelligence
Rolai

Never worry about agent reliability

We handle tool reliability, observability, and security so you never have to second-guess an agent action.