TABLE OF CONTENTS
Overview
The Stack Internal MCP server helps your MCP-compatible assistant search and retrieve indexed Stack Internal knowledge. To learn more about connecting to and using the Stack Internal MCP server, read the following articles.
- MCP Server Quickstart Quickly connect to and use the MCP server.
- MCP Server Connection Guide How to connect many tools (for example: Claude, Codex, Cursor, Gemini) to the MCP server.
- MCP Use Cases Examples of how to use the MCP server.
MCP tools
The Stack Internal MCP server provides read-only search_nodes and get_node tools. When available for your workspace and permissions, it also provides list_scopes and create_scope.
search_nodes
search_nodes searches indexed Node Extractor nodes. It accepts a query, a results limit (up to 100), and an optional search algorithm. To search one Scope, pass its ID as scope_id. Omit scope_id for a broad search of your organisation's accessible knowledge.
To choose a search method, set the optional algorithm field to one of the following values.
- lexical_v1 for term-based matching. Use it for exact names, acronyms, error codes, or identifiers such as "usage_credits_exhausted".
- semantic_v1 for meaning-based matching. Use it when the source may use different wording, such as searching for “how to handle confidential information” instead of “PII logging guidance.”
If you don't specify search algorithm, the server chooses its default method.
get_node
get_node retrieves a node by ID. Use the node ID from a search result when you need the full available text and metadata. It does not accept a Scope selector.
list_scopes
list_scopes lists the Scopes you can access. Start at page 1, use a pageSize of 10, 25, 50, or 100, and continue while hasNextPage is true. Listing Scopes does not use knowledge credits.
create_scope
create_scope creates an empty Scope. Provide a title and the required boolean restricted field: set restricted to true to limit access, or false to make the Scope visible to workspace members. Creating a Scope does not edit source content or select it for future searches.
Specify Scopes when searching
A Scope is a named selection of knowledge for a topic, project, or team. If you don't want to search all of your organisation's accessible knowledge, you can use Scopes to narrow a search.
- Use
list_scopesto find the Scopes you can access. - Pass one returned Scope ID in
scope_idwhen you callsearch_nodes. - Search multiple relevant Scopes separately.
A Scope selection applies only to one search. search_nodes does not return a Scope ID or Scope name, so retain the Scope you selected when you cite or describe the supporting results. Note that specifying Scopes narrows a search but does not grant additional source access.
Agent instructions
If your client supports agent instructions, tell it to:
- Search before relying on general guidance. For example, add “Search first, then cite the most relevant source” to relevant instructions or prompts.
- Discover and search relevant Scopes first when Scope tools are available. Broaden by omitting
scope_idonly when no relevant Scope exists or scoped results are insufficient. Never broaden beyond a user's explicit Scope restriction, or treat authentication, permission, or credit errors as empty search results.
Result quality and trust score
Search results can include trust_score when upstream trust data is available. score remains the search relevance score. A missing trust_score means no score was supplied—it doesn't mean the content is not trustworthy. Trust score or none, check linked sources before using an AI-generated answer for important decisions.
Knowledge credits
Each successful MCP or API search that returns one or more nodes uses 0.25 knowledge credits. Empty and failed searches do not use credits, and list_scopes does not use knowledge credits. Do not retry after receiving a usage_credits_exhausted error. Instead, contact a workspace administrator for upgrade guidance if you cannot manage the workspace.
Use service accounts for unattended integrations
Use a service account when an automated job or server integration needs to connect to the MCP server without a person signing in through a browser. A service account acts as its own machine identity. It does not inherit its creator's role, group membership, or access to private source content.
A workspace administrator creates the service account, assigns the minimum required permissions, and creates a credential. The integration exchanges its client ID and secret for an access token, then sends that token as a bearer token when the MCP client supports machine credentials.
For more details, see the Service Accounts article. Confirm that the MCP client and the MCP tools you need support service account authentication before using this route. Service accounts are available for Organization workspaces only.