Stack Exchange MCP server for AI agents

Live

OAUTH 2.0

DEVELOPER Q&A

Developer Tools

Stack Exchange gives your agent developer Q&A across Stack Overflow and the rest of the network: search questions, read answers and comments, post and edit as the user, vote, and track inbox and reputation.

  • Per-user credentials: each call uses the actual user's token, never a shared bot.
  • Encrypted per-tenant vault: AES-256, resolved at request time, never in LLM context.
  • Scoped before every call: pre-call scope check, 90-day SIEM-exportable audit chain.
Stack Exchange
agent · Acme Q3
Run
Find well-answered Stack Overflow questions about Postgres advisory locks.
S
stackexchange_questions_search_advanced
127ms
Developer agent
I found 12 questions with accepted answers. The top one has a score of 214 and compares pg_try_advisory_lock with pg_advisory_lock.
Sources: Stack Overflow, 12 questions
stackexchange
12 questions
18:29
Message Claude...

Tools your developer agent reaches for on Stack Exchange, scoped per user.

CALL ANY TOOL
113 tools for developer Q&A on Stack Exchange: search and read questions, answers, comments, and tags, post and edit questions and answers, vote and bookmark, and read the user's inbox, reputation, and badges.
stackexchange_answer_accept
Answer accept
Mark an answer as accepted on a question the signed-in user asked. Returns the accepted answer. Use this only on answers to the user's own questions, when no other answer is accepted. Use stackexchange_answer_accept_undo to remove the accept. Requires the write_access scope.
Parameters
Name
Type
Required
Description
answer_id
integer
Required
ID of the answer.
site
string
Required
Stack Exchange site to use, as its api_site_parameter (for example stackoverflow, superuser, serverfault, askubuntu, math) or full domain (stackoverflow.com). Get the values from stackexchange_sites_list.
preview
boolean
Optional
true to validate the request and return the would-be result without saving anything (default false).
stackexchange_answer_comments_list
List answer comments
stackexchange_answer_create
Create answer
stackexchange_answer_delete
Delete answer
stackexchange_answer_downvote_undo
Answer downvote undo
stackexchange_answer_edit
Answer edit
stackexchange_answers_get
Get answers
stackexchange_badge_recipients_list
List badge recipients
stackexchange_collective_tags_list
List collective tags
stackexchange_comment_upvote_undo
Comment upvote undo
stackexchange_filters_get
Get filters
stackexchange_inbox_list
List inbox
stackexchange_me_badges_list
List me badges
stackexchange_me_privileges_list
List me privileges
stackexchange_me_tags_list
List me tags
stackexchange_notifications_unread_list
List notifications unread
stackexchange_posts_list
List posts
stackexchange_question_downvote_undo
Question downvote undo
stackexchange_question_linked_list
List question linked
stackexchange_question_timeline_get
Get question timeline
stackexchange_questions_no_answers_list
List questions no answers
stackexchange_questions_search
Search questions
stackexchange_tag_faq_list
List tag faq
stackexchange_tag_synonyms_get
Get tag synonyms
stackexchange_tag_top_askers_list
List tag top askers
stackexchange_user_associated_list
List user associated
stackexchange_user_mentions_list
List user mentions
stackexchange_user_questions_list
List user questions
stackexchange_user_reputation_list
List user reputation
stackexchange_user_top_tags_list
List user top tags

For more tools, view docs.

Build your Agent
Same auth pattern across LangChain, OpenAI, Anthropic, and Google ADK.
Python · LlamaIndex
import { ScalekitClient } from "@scalekit-sdk/node";
import { createReactAgent } from "@langchain/langgraph/prebuilt";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);

// Stack Exchange tools scoped to this user
const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["stackexchange"], toolNames: [
    "stackexchange_questions_search_advanced",
    "stackexchange_question_answers_list",
    "stackexchange_answer_create"] },
  pageSize: 100,
});

const agent = createReactAgent({ llm, tools });
await agent.invoke({ messages: [{ role: "user", content: "Find accepted answers on Stack Overflow about Postgres advisory locks" }] });
import OpenAI from "openai";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);
const openai = new OpenAI();

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["stackexchange"] }, pageSize: 100,
});

const res = await openai.chat.completions.create({
  model: "gpt-5",
  messages: [{ role: "user", content: "Find accepted answers on Stack Overflow about Postgres advisory locks" }],
  tools,
});

// Execute the tool call with the user's vaulted Stack Exchange OAuth token
await sk.tools.executeTool(res.choices[0].message.tool_calls[0], "user_123");
import Anthropic from "@anthropic-ai/sdk";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);
const anthropic = new Anthropic();

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["stackexchange"] }, pageSize: 100,
});

const msg = await anthropic.messages.create({
  model: "claude-sonnet-5",
  max_tokens: 1024,
  messages: [{ role: "user", content: "Find accepted answers on Stack Overflow about Postgres advisory locks" }],
  tools,
});

// Tool call runs with the user's vaulted Stack Exchange OAuth token
await sk.tools.executeTool(msg.content, "user_123");
import { Agent } from "@google/adk/agents";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["stackexchange"] }, pageSize: 100,
});

const agent = new Agent({
  name: "developer_agent",
  model: "gemini-2.5-pro",
  instruction: "Stack Exchange tools scoped to this user",
  tools,
});

await agent.run("Find accepted answers on Stack Overflow about Postgres advisory locks");
Try these prompts
Copy any prompt into your agent. Each maps directly to a Stack Exchange tool. Click to copy, paste into your agent, done.
Search and read
Copy the prompt
Copied
Search Stack Overflow for accepted answers about Postgres advisory locks.
Copy the prompt
Copied
Find questions similar to: How do I retry a failed Celery task?
Copy the prompt
Copied
List the FAQ questions in the rust tag.
Post and engage
Copy the prompt
Copied
Post an answer to question 78451230 with this code sample.
Copy the prompt
Copied
Upvote the accepted answer on question 11227809.
Copy the prompt
Copied
Bookmark question 4842424 for later.
My account
Copy the prompt
Copied
Show my unread inbox items across all sites.
Copy the prompt
Copied
What are my top tags on Stack Overflow?
Copy the prompt
Copied
List unanswered questions in my favorite tags.
SEE HOW AUTH WORKS
Each user signs in to Stack Exchange once, and Scalekit stores and refreshes their tokens. Credentials stay vaulted, every call is scope checked, and every action is logged.
1
Authorize
Your user connects
Stack Exchange
once. We tie it to their identity and the meetings they approved — no shared bot account, no org-wide access
Who:
user ‘A’
when:
Once per user
access:
Limited to user
2
Store
Their
Stack Exchange
token lives in a vault scoped to them. User A's meetings are never reachable by an agent acting for user B, even on the same connection
vault:
encrypted
scope:
per-user
tokens:
auto-refreshed
3
Resolve
When your agent calls a
Stack Exchange
tool, we fetch the right token server-side. It never touches your agent, never appears in the LLM context, never shows up in your logs
speed:
~40ms
check:
before every call
seen by:
nobody
4
Audit
Every
Stack Exchange
tool call is logged — who triggered it, which meeting was fetched, what came back. 90 days of history, tied to the user who authorized it
history:
90 days
export:
SIEM-ready
logged:
every call
Test other agents
See the same per-user auth pattern across other developer tools and knowledge connectors.
Engineering Teams
Engineering standup agent
Pulls commits from GitHub and GitLab, tracks issue movement in Jira, and posts a per-engineer standup brief to Slack. Each engineer's activity is read on their own delegated OAuth.
Engineering Teams
Slack triage
Polls Slack for new messages, classifies bugs and support requests with a LangGraph router, files GitHub issues or Zendesk tickets, and confirms in the thread.
Test other agents
See the same per-user auth pattern across other developer tools and knowledge connectors.
ENGINEERING
Engineering standup agent
Pull commits from GitHub and GitLab, track Jira issue movement, and post a per-engineer standup brief to Slack.
ENGINEERING
Slack triage agent
Classify new Slack messages as bugs or support requests, file the GitHub issue or Zendesk ticket, and reply in the thread.
Why Scalekit
Secure your agent's access. Connectors ship in minutes
01.
Shared tokens break per-user analytics
A shared Stack Exchange token looks fine in a demo. In production every answer and vote looks like one service account, and you cannot tell which user triggered it. Scalekit resolves the credential of the actual user who triggered the agent, never a shared bot.
// shared token
audit → bot_service_account

// scalekit
audit → user_abc ✓
02.
Authentication is not authorization
03.
Multi-tenancy is architectural
04.
Stack Exchange today. Ten connectors tomorrow.
“Our agents act across Salesforce, Gong, Google Drive, and more, on behalf of every customer. Scalekit behind the scenes meant we can keep adding tools without ever rebuilding how credentials or tool calling work.”
Venu Madhav Kattagoni
Head of Engineering / Von
FAQs
Frequently Asked Questions
Does the agent access Stack Exchange as the user or through a shared service account?
As the user. Each user signs in to Stack Exchange once, and Scalekit stores and refreshes their tokens. Questions, answers, comments, and votes the agent posts appear under that user's account and in your audit trail, not a shared service account.
Where is the Stack Exchange OAuth token stored?
In Scalekit's managed AES-256 token vault, namespaced per tenant. Refresh is automatic. Revocation is a single dashboard action. Credentials never appear in prompts, logs, or LLM context.
Can I limit what the agent does in Stack Exchange?
Yes. Filter by tool name in listScopedTools to expose only what you want, for example search and read tools without stackexchange_answer_create and stackexchange_question_delete, so the agent can research but never post or delete. Scalekit also enforces scope checks before every API call.
What happens when a user revokes Stack Exchange access?
The connection is invalidated on the next tool call. Subsequent requests for that user fail closed with a clear error. Other users in the tenant remain unaffected. The event is logged for audit.
Which Stack Exchange sites can the agent use?
Any site in the network. stackexchange_sites_list returns every site, including Stack Overflow, Super User, Server Fault, and Ask Ubuntu, and most tools take the site as a parameter. Inbox and notification tools read across all sites at once.
Start in your coding agent
Up and running in one command
Install the Scalekit skill in your editor of choice. Connector, auth, tools, prompt, all wired up
Claude Code REPL
/plugin marketplace add scalekit-inc/claude-code-authstack
/plugin install agentkit@scalekit-auth-stack
Cursor Code REPL
# ~/.cursor/mcp.json
{
""mcpServers"": {
""stackexchange"": {
""url"": ""https://mcp.scalekit.com/stackexchange"",
""headers"": { ""Authorization"": ""Bearer $SCALEKIT_TOKEN"" }
}
}
}
Codex Code REPL
# ~/.codex/config.toml
[mcp_servers.stackexchange]
url = ""https://mcp.scalekit.com/stackexchange""
auth_env = ""SCALEKIT_TOKEN""
Copilot Code REPL
# .vscode/mcp.json
{
""servers"": {
""stackexchange"": {
""url"": ""https://mcp.scalekit.com/stackexchange"",
""type"": ""http""
}
}
}