Support
How to access and use the MCP server.
Applies to:
Free
Basic
Business
Enterprise

Overview

The Stack Internal MCP Server allows you to connect your AI coding agents to your organization's verified knowledge base. It provides structured, secure read and write access to your team's content so agents can search your Stack Internal site before falling back to generic knowledge. The MCP server enables AI coding agents, AI assistants, and custom agents to:

  • Read trusted, high-quality enterprise knowledge to improve their outputs.
  • Capture, draft, create, and edit questions, answers, and articles from within their own interface, seamlessly storing enterprise knowledge back to your Stack Internal site.

We're providing this feature as a free trial for a limited time. If you wish to continue using the MCP server, have your site administrator reach out to their Stack Overflow account representative.

To learn more about the inner workings of the Stack Internal MCP server, read the MCP Server Architecture article.

MCP Server landing page

To access documentation, one-click installs, agent connection example code, tools, prompts, and more, go to https://[your_site].stackenterprise.co/mcp.

JSON connection code

You can connect to any MCP-compatible client using the following JSON:

{
  "mcpServers": {
    "stack-internal": {
      "url": "https://[your_site].stackenterprise.co/mcp",
      "headers": {}
    }
  }
}

The Stack Overflow Internal MCP Server uses streamable HTTP as its transport method. It does not support Server-Sent Events (SSE).

Authentication

The Stack Internal Enterprise MCP server uses OAuth 2.0 with PKCE for secure authentication.

  • You'll authenticate with your Stack Internal account. The MCP client (for example: Copilot, Cursor, JetBrains Assistant, or Claude Code) will open a browser window for login and token exchange.
  • After Stack Internal Enterprise creates a new API service application for the MCP server, admins manage client registration and API access at https://[your_site].stackenterprise.co/enterprise/api.
  • Tokens are short-lived and scoped to the authenticated user. The MCP server doesn't support long-lived static tokens, so agents must refresh tokens as needed.
  • The MCP server enforces security at both the user and tenant level, and logs all requests for governance and attribution.

Example connection flow (VS Code)

  1. MCP client requests authorization, redirects user to Stack Internal Enterprise login.

  2. User signs in with SSO or Stack Internal credentials.

  3. Authorization server returns a short-lived access token and refresh token.

  4. MCP client exchanges the token for access to the MCP server endpoint at https://[your_site].stackenterprise.co/mcp.

If you're building a custom internal agent, you'll need to implement the standard OAuth 2.0 with PKCE flow. Your agent will use the MCP server URL at https://[your_site].stackenterprise.co/mcp. If you require different authentication methods, reach out to your contact at Stack Overflow.

Prompts

Prompts provide pre-built instructions to guide agents on how to use the MCP server. Prompts provide instructions for how to use the tools and resources available.

PROMPT DESCRIPTION
search Query Stack Internal Enterprise for existing questions, answers, or articles.
create_question Post a new question. Requires tags from get_existing_tags.
create_article Publish a knowledge article. Requires tags from get_existing_tags.
create_QA Post a question and answer pair. Requires tags from get_existing_tags.

In addition to using natural language, you can invoke prompts by preceding them with the '/' character.

Prompt examples

  • How do I configure PKCE authentication? (invokes search prompt)
  • /create_question "Error when connecting to remote MCP server"

Tools

The MCP server exposes the following tools to MCP clients. Clients can invoke tools through normal conversations with the agent, or through '#' commands.

TOOL DESCRIPTION
search Find questions, answers, and articles by keyword. Returns titles, tags, and IDs. Use get_question or get_article for full content.
get_question Retrieve a question with all its answers, authors, scores, and accepted status.
get_article Retrieve a full article by ID.
get_comments Read comments on a question or a specific answer. Read-only; creating comments requires the web UI.
get_questions_to_answer Find questions without an accepted answer, filtered by topic or tag. Results may include questions that have answers but no accepted answer.
get_existing_tags List all available tags with their IDs. Required before creating content.
recommend_SME Find subject matter experts for a given tag based on Stack Internal activity. Takes a tag ID, so call get_existing_tags first.
create_article Publish a knowledge article. Requires tags from get_existing_tags.
create_question Post a new question. Requires tags from get_existing_tags.
create_QA Post a question and answer pair. Requires tags from get_existing_tags.
draft_question Draft a question for review without posting. Drafts are auto-tagged as ai-generated for provenance.
submit_user_answer Post an answer to an existing question.
update_answer Edit an existing answer.
update_question Edit an existing question's title, body, or tags.
vote Add or remove an upvote or downvote on a question or answer.

Tool examples

  • How do I configure PKCE authentication? (invokes search tool)
  • #get_question 3172

How it works

To use an analogy of building furniture, you can think of prompts as the directions and tools as your hammer and nails.

Prompts = Directions
Prompts are natural-language instructions your agent follows (for example: "Find related answers" or "Draft an article"). Prompts are great for everyday users in chat/IDE.

Tools = Hammer and Nails
Tools are the specific actions the agent can take (for example: search, create content, retrieve details). Tools are ideal when you're creating repeatable, automated workflows.

Prompts guide the work, and tools do the work.

You can control the default behavior of your agent, including how and when it invokes specific MCP tools, with an agent instructions file. Learn more in the MCP Server Agent instructions article.

Usage examples

Agents will automatically invoke MCP server functions based on key words you use. The example below shows how the natural language prompt "Search teams..." caused the agent to invoke the search prompt.

You can also invoke prompts by preceding them with the '/' character.

You can explicitly invoke tools by preceding them with the '#' character.

To verify that your client is connected, try a simple plain-text query such as Search Stack Internal for any content about [a topic your team covers].

For more usage examples, check out the MCP Server Use Cases article.

Next steps

This quickstart guide gets you started connecting to the MCP server. To unlock more features and capabilities, read the Stack Internal MCP server articles below.

Still have questions? Check out the MCP Server FAQ article.

If you're having problems accessing or using your MCP server, reach out to support.

https://doc-automation.netlify.app/pdfs/internal/enterprise/integrations_and_api/mcp_server/MCP_server_quickstart.pdf

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article