Set up Stack Exchange in Metorial for Claude, ChatGPT and Cursor
Share Stack Exchange with your team in Claude, ChatGPT and Cursor through Metorial: OAuth or API key sign-in, 16 tools (10 read-only).
To give your team Stack Exchange in Claude, ChatGPT, Cursor and other AI clients, an admin shares the Stack Exchange integration in a Metorial portal, and each person signs in to Stack Exchange with their own account. Agents can search and read Stack Exchange questions, answers, tags, user profiles, reputation changes, and post revisions. The integration has 16 tools, 10 read-only and 6 destructive, plus 3 triggers.
What you'll learn
- How an admin shares Stack Exchange in a portal and how each person connects
- The 4 OAuth scopes Stack Exchange can request, and what each one allows
- How to keep the 10 read-only tools and reject the other 6
Before you start
- A portal with at least one access group
- An account with Stack Exchange for each person who connects
- For the CLI steps: the Metorial CLI, signed in to your portal
Sign-in methods
| Method | Type | What a person provides |
|---|---|---|
| OAuth (default) | OAuth | Signs in to Stack Exchange after entering apiKey |
| API Key | API token | apiKey |
The portal and metorial setup use OAuth unless someone picks another method.
OAuth
Before the sign-in, setup asks for:
apiKey: Your Stack Exchange API key (application key) from stackapps.com
People sign in to Stack Exchange and approve the scopes you allow. The integration can request:
| Scope | Name | What it allows |
|---|---|---|
read_inbox | Read Inbox | Access to your global inbox across the Stack Exchange network. |
write_access | Write Access | Ability to perform write operations such as posting comments and editing. |
private_info | Private Info | Access to your private information such as email address. |
no_expiry | No Expiry | Produces an access token that does not expire. |
API Key
To connect, a person enters:
apiKey: Your Stack Exchange API key (application key) from stackapps.com
Setup settings
Whichever method you pick, setup also asks for:
site(optional): The Stack Exchange site to query (e.g., stackoverflow, serverfault, superuser, askubuntu)
Use your own Stack Exchange OAuth app
With your own OAuth app, people see your company's name on the Stack Exchange consent screen, and the client ID and secret belong to you.
Start the credentials in Metorial
In the dashboard, select Settings, then Organization Settings. Under Integrations and MCP, select Provider Auth, then Create Auth Credentials. Choose Stack Exchange and copy the Redirect URI.
Register the app with Stack Exchange
Create an OAuth app or client in Stack Exchange and add the redirect URI from Metorial as its redirect or callback URL.
Finish in Metorial
Copy the app's client ID and client secret. Back in Metorial, enter a Name, the Client ID and the Client Secret, review Scopes, and select Create. Then pick these credentials for the Stack Exchange integration.
Admin: share Stack Exchange in a portal
In the dashboard
Open Shared Resources
Open Workforce, choose the portal, and select Shared Resources under Access.
Share a new integration
Select Share a Resource, then New Integration, and choose Stack Exchange. Under Auth Method, keep OAuth or pick another. For how members connect, choose Each person connects, so everyone signs in to Stack Exchange as themselves.
Limit the tools
Under Tool Filters, set the write and destructive groups to Reject if agents should only read from Stack Exchange.
Choose who gets it
Add the access groups that should see Stack Exchange. When a person asks for access from the portal, the request appears under Access Requests.
With the CLI
The CLI cannot create the per-user Stack Exchange integration. Once it exists, check which groups have it:
Employee: connect Stack Exchange
In the portal
Open Stack Exchange in the catalog
Sign in to your portal and open Stack Exchange. The status reads Available.
Authenticate
Under Quick setup, select Authenticate. A Stack Exchange sign-in tab opens. Sign in and approve the permissions listed.
Confirm
The status changes to Configured. If it later reads Needs reconnect, select Reconnect and sign in again.
With the CLI
catalog search prints the catalog item ID. metorial setup uses OAuth. To connect with API Key instead, find its ID with metorial catalog get <catalog-item-id> and add --auth-method <auth-method-id>.
Add it to your AI client
metorial install adds your Stack Exchange connection to a local MCP client such as Claude Code, Cursor or Codex. metorial list prints the integration ID and metorial client list the client identifiers.
For a client that takes a server URL, such as ChatGPT, metorial install custom <integration-id> creates an installation token and shows the endpoint details.
Make it read-only
Open the integration's Tool Filters and set the write and destructive groups to Reject. Agents keep the 10 read-only tools, such as get_user and get_inbox, and lose the 6 destructive tools, such as edit_answer or post_answer.
Employees see the result on the integration's page in the portal under Tool access. For the full walkthrough, see Tool permissions.
Check it worked
metorial tools lists the 16 tools, minus any you rejected. get_user takes no input. It retrieves a user's profile including reputation, badge counts, and top tags.
To see every input a tool takes, run metorial schema <integration-id> <tool-key>.
Tools
Read-only tools (10)
get_answers: Retrieve answers for a specific question or by answer IDs.list_sites: List all sites in the Stack Exchange network.search_questions: Search for questions across a Stack Exchange site using keywords, tags, and advanced filters.get_question: Retrieve a question by its ID along with its answers and comments. NeedsquestionId.get_post_revisions: View the revision history of a question or answer, showing how the post has changed over time. NeedspostId.get_user: Retrieve a user's profile including reputation, badge counts, and top tags.get_inbox: Retrieve the authenticated user's global inbox or unread inbox items.browse_tags: Browse and search tags on a Stack Exchange site.get_user_activity: Retrieve a user's recent questions, answers, or reputation changes. NeedsuserIdandactivityType.get_notifications: Read your Stack Exchange notifications, optionally restricted to unread notifications.
Destructive tools (6)
manage_comment: Add, edit, or delete a comment on a question or answer. Needsaction.post_answer: Post an answer to a question on a Stack Exchange site. NeedsquestionIdandbody.post_question: Create a new question on a Stack Exchange site. Needstitle,bodyandtags.accept_answer: Accept an answer to your question, or undo acceptance.edit_answer: Edit the body of an answer.edit_question: Edit a question title, body, and tags.
Triggers
Stack Exchange has 3 triggers, which fire on events in Stack Exchange:
new_questions: Triggers when new questions are posted on a Stack Exchange site.inbound_webhooknew_answers: Triggers when new answers are posted on a Stack Exchange site.
Next steps
- Claude Code, Cursor, Codex and ChatGPT: connect each client to your portal and use Stack Exchange there
- Create custom OAuth credentials: the Provider Auth screens in more detail
- Tool permissions: tool filters and what employees see
- Stack Exchange on metorial.com: the integration overview