Protect an MCP server from prompt injection, token theft, SSRF, command injection, session hijacking, excessive permissions, and supply-chain attacks.
MCP server security is the set of controls that protects an MCP server, its users, connected systems, and credentials from unauthorized access or misuse.An MCP server sits between an AI application and external capabilities. It must handle traditional API risks plus AI-specific risks such as prompt injection, unsafe tool selection, and untrusted model output.
User -> AI host -> MCP client -> MCP server -> External API or system | | untrusted security content boundary
Security must be enforced by code and policy. A model’s decision to call a tool is never proof that the operation is safe or authorized.
Instructions hidden in user input, documents, web pages, or tool results can manipulate the model into calling a tool or disclosing data.Treat all external content as untrusted. Do not let retrieved text override authorization policy. Require user confirmation for sensitive actions and validate the final tool arguments independently of the conversation.
A malicious or compromised server can publish deceptive tool names or descriptions. A trusted server can also change behavior after a user approves it.Show users which server provides each tool. Review tool changes, pin trusted versions where possible, and monitor unexpected changes to names, schemas, or descriptions.
A read-only tool does not need an administrator token. Broad credentials increase the impact of prompt injection, implementation bugs, and credential theft.Use separate identities and scopes for separate functions. Enforce permissions at the MCP server and again at the upstream system.
Access tokens are bearer credentials. Anyone who obtains one may be able to use it until it expires or is revoked.The official MCP security guidance prohibits accepting an MCP access token and forwarding it unchanged to an upstream API. The MCP server must validate that tokens are intended for itself. If it needs to access another protected service, it should use a separate, audience-appropriate credential or a secure token-exchange design.
An upstream API credential explicitly provided for that API is not the same as an MCP access token. Keep the two credential purposes and audiences separate.
Tools that fetch user-provided URLs can be abused to reach internal services, cloud metadata endpoints, or unauthorized hosts.Use strict URL parsing, allowlisted schemes and domains, DNS and IP checks, redirect validation, egress filtering, timeouts, and response-size limits.
If a remote server uses sessions, an attacker who steals or predicts a session identifier may impersonate another connection or inject messages.Use cryptographically secure identifiers, bind session state to the authenticated identity, never use sessions as authentication, rotate or terminate them appropriately, and protect all traffic with TLS.
A local stdio server runs with the user’s operating-system permissions. A malicious package or server command may read files, environment variables, browser data, or developer credentials.Install local servers only from trusted sources. Pin dependencies, inspect startup commands, minimize environment variables, sandbox processes, and restrict filesystem and network access.
Do not log tokens, API keys, full authorization headers, or sensitive payloads.Prepare an incident process for revoking credentials, disabling tools, pausing the server, preserving audit data, notifying affected users, and restoring a reviewed version.
A secure MCP server treats the model, client input, server metadata, retrieved content, and upstream responses as untrusted while enforcing identity, permission, validation, and least privilege at every boundary.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"0mcp","description":"Learn how to turn an API into a hosted MCP server with 0mcp.","colors":{"primary":"#E78468","light":"#E78468","dark":"#E78468"},"logo":{"light":"https://mintcdn.com/0mcp/edbyRvIT5oXg-bmk/logo/light.svg?fit=max\u0026auto=format\u0026n=edbyRvIT5oXg-bmk\u0026q=85\u0026s=47de7cdcf15a79f5ed16caffaaad0def","dark":"https://mintcdn.com/0mcp/edbyRvIT5oXg-bmk/logo/dark.svg?fit=max\u0026auto=format\u0026n=edbyRvIT5oXg-bmk\u0026q=85\u0026s=e47198408143a0764045a96c51ff89a5"},"favicon":{"light":"https://mintcdn.com/0mcp/8h2cSvgiqp3fmCjm/favicon-light.svg?fit=max\u0026auto=format\u0026n=8h2cSvgiqp3fmCjm\u0026q=85\u0026s=445edf6c61f65c138b41c76927758f88","dark":"https://mintcdn.com/0mcp/8h2cSvgiqp3fmCjm/favicon-dark.svg?fit=max\u0026auto=format\u0026n=8h2cSvgiqp3fmCjm\u0026q=85\u0026s=7b1062ca254caa729c3e72ab98105fcc"},"appearance":{"default":"dark","strict":true},"navbar":{"links":[{"href":"https://0mcp.io","label":"Website"},{"href":"mailto:[email protected]","label":"Support"}],"primary":{"type":"button","label":"Dashboard","href":"https://0mcp.io/dashboard"}},"footer":{"socials":{"x":"https://x.com/0mcpIO","linkedin":"https://www.linkedin.com/company/0mcp"}},"seo":{"metatags":{"canonical":"https://docs.0mcp.io"},"indexing":"all"},"icons":{"library":"lucide"},"styling":{"eyebrows":"breadcrumbs","latex":false},"contextual":{"options":["copy","view","assistant","mcp","add-mcp"],"display":"header"},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"0mcp","hasAudioNarration":false,"actualSubdomain":"0mcp","customDomains":["docs.0mcp.io"],"gitSource":{"type":"github","owner":"0mcpio","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"collectionId":"c03b4e48-c5f6-4b0e-ba86-b0d8a9caf05c","liveDeploymentHistoryId":"6a7a0140a1755e35467dc5f0","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6a7a0140a1755e35467dc5f0"},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6a7a0140a1755e35467dc5f0:success","clientVersion":"0.0.4045","searchFilterCounts":[{"language":"default","tag":"Learn MCP","count":40},{"language":"default","tag":"Documentation","count":31},{"language":"default","tag":"Fundamentals","count":15},{"language":"default","tag":"Guides","count":14},{"language":"default","tag":"MCP Best Practices","count":9},{"language":"default","tag":"Build MCP Server","count":6},{"language":"default","tag":"MCP Core Concepts","count":6},{"language":"default","tag":"Setup","count":5},{"language":"default","tag":"API sources","count":4},{"language":"default","tag":"MCP Security","count":4}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"/* vietnamese */\n@font-face {\n font-family: 'Chivo';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/chivo/v21/va9I4kzIxd1KFrBnQeNHkQ.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Chivo';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/chivo/v21/va9I4kzIxd1KFrBmQeNHkQ.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Chivo';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/chivo/v21/va9I4kzIxd1KFrBoQeM.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n/* vietnamese */\n@font-face {\n font-family: 'Chivo';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/chivo/v21/va9I4kzIxd1KFrBnQeNHkQ.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Chivo';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/chivo/v21/va9I4kzIxd1KFrBmQeNHkQ.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Chivo';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/chivo/v21/va9I4kzIxd1KFrBoQeM.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n/* vietnamese */\n@font-face {\n font-family: 'Chivo';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/chivo/v21/va9I4kzIxd1KFrBnQeNHkQ.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Chivo';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/chivo/v21/va9I4kzIxd1KFrBmQeNHkQ.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Chivo';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/chivo/v21/va9I4kzIxd1KFrBoQeM.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n/* vietnamese */\n@font-face {\n font-family: 'Chivo';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/chivo/v21/va9I4kzIxd1KFrBnQeNHkQ.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Chivo';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/chivo/v21/va9I4kzIxd1KFrBmQeNHkQ.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Chivo';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/chivo/v21/va9I4kzIxd1KFrBoQeM.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n/* cyrillic-ext */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPx3cwhsk.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPxTcwhsk.woff2) format('woff2');\n unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* greek */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPxPcwhsk.woff2) format('woff2');\n unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;\n}\n/* vietnamese */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPx_cwhsk.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPx7cwhsk.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPxDcwg.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n/* cyrillic-ext */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPx3cwhsk.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPxTcwhsk.woff2) format('woff2');\n unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* greek */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPxPcwhsk.woff2) format('woff2');\n unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;\n}\n/* vietnamese */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPx_cwhsk.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPx7cwhsk.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPxDcwg.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n/* cyrillic-ext */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPx3cwhsk.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPxTcwhsk.woff2) format('woff2');\n unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* greek */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPxPcwhsk.woff2) format('woff2');\n unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;\n}\n/* vietnamese */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPx_cwhsk.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPx7cwhsk.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPxDcwg.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n/* vietnamese */\n@font-face {\n font-family: 'Space Grotesk';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/spacegrotesk/v22/V8mDoQDjQSkFtoMM3T6r8E7mPb54C-s0.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Space Grotesk';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/spacegrotesk/v22/V8mDoQDjQSkFtoMM3T6r8E7mPb94C-s0.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Space Grotesk';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/spacegrotesk/v22/V8mDoQDjQSkFtoMM3T6r8E7mPbF4Cw.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n/* vietnamese */\n@font-face {\n font-family: 'Space Grotesk';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/spacegrotesk/v22/V8mDoQDjQSkFtoMM3T6r8E7mPb54C-s0.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Space Grotesk';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/spacegrotesk/v22/V8mDoQDjQSkFtoMM3T6r8E7mPb94C-s0.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Space Grotesk';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/spacegrotesk/v22/V8mDoQDjQSkFtoMM3T6r8E7mPbF4Cw.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n/* vietnamese */\n@font-face {\n font-family: 'Space Grotesk';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/spacegrotesk/v22/V8mDoQDjQSkFtoMM3T6r8E7mPb54C-s0.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Space Grotesk';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/spacegrotesk/v22/V8mDoQDjQSkFtoMM3T6r8E7mPb94C-s0.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Space Grotesk';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/spacegrotesk/v22/V8mDoQDjQSkFtoMM3T6r8E7mPbF4Cw.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n/* vietnamese */\n@font-face {\n font-family: 'Space Grotesk';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/spacegrotesk/v22/V8mDoQDjQSkFtoMM3T6r8E7mPb54C-s0.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Space Grotesk';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/spacegrotesk/v22/V8mDoQDjQSkFtoMM3T6r8E7mPb94C-s0.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Space Grotesk';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/spacegrotesk/v22/V8mDoQDjQSkFtoMM3T6r8E7mPbF4Cw.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n:root{--default-border-color:var(--gray-200);--docs-dashboard-bg:#0b0b0b;--docs-dashboard-sidebar:#0b0b0b;--docs-dashboard-surface:#171717;--docs-dashboard-surface-raised:#171717;--docs-dashboard-border:#171717;--docs-dashboard-border-strong:#171717;--docs-dashboard-text:#f4f4f5;--docs-dashboard-muted:#a3a3a3;--docs-dashboard-subtle:#737373;--docs-dashboard-accent:#e78468;--docs-dashboard-accent-2:#8dcdff}.dark{--default-border-color:var(--gray-800);--gray-50:244 244 245;--gray-100:229 229 229;--gray-200:212 212 212;--gray-300:163 163 163;--gray-400:115 115 115;--gray-500:82 82 82;--gray-600:64 64 64;--gray-700:38 38 38;--gray-800:28 28 28;--gray-900:18 18 18;--gray-950:10 10 10}body,html{font-family:'Space Grotesk',Inter,ui-sans-serif,system-ui,sans-serif!important;background:var(--docs-dashboard-bg)!important;color:var(--docs-dashboard-text)!important}.font-display,.font-heading,[class*=font-serif],h1,h2,h3,h4,h5,h6{font-family:Chivo,'Space Grotesk',Inter,ui-sans-serif,system-ui,sans-serif!important;letter-spacing:0!important}[class*=font-mono],code,kbd,pre,samp{font-family:'JetBrains Mono',ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace!important}header#navbar{background:rgb(11 11 11/.92)!important;border-bottom:1px solid var(--docs-dashboard-border)!important;backdrop-filter:blur(16px)}#sidebar{border-right:1px solid var(--docs-dashboard-border)!important}#navigation-items,#sidebar,#sidebar-content,#sidebar-content>div{background:var(--docs-dashboard-sidebar)!important}#sidebar-content>div>.sticky{background:linear-gradient(to bottom,var(--docs-dashboard-sidebar),rgb(18 18 18/0))!important}#sidebar :is(a, button){border-radius:0!important}#sidebar .nav-anchor,#sidebar .nav-dropdown-trigger{min-height:2.25rem;color:var(--docs-dashboard-muted)!important;font-size:13px!important;transition:background-color 160ms ease,color 160ms ease}#sidebar .nav-anchor:hover,#sidebar .nav-dropdown-trigger:hover{background:rgb(255 255 255/.05)!important;color:var(--docs-dashboard-text)!important}#sidebar a[aria-current=page],#sidebar li[data-active-nav-item=true]>a,#sidebar li[data-active=true]>a{background:rgb(231 132 104/.12)!important;color:var(--docs-dashboard-accent)!important;font-weight:600!important}#sidebar a[aria-current=page] span,#sidebar li[data-active-nav-item=true]>a span,#sidebar li[data-active=true]>a span{color:inherit!important}#sidebar a[aria-current=page] svg,#sidebar li[data-active-nav-item=true]>a svg,#sidebar li[data-active=true]>a svg{color:currentColor!important;background-color:currentColor!important}#sidebar :is(.nav-anchor, .nav-dropdown-trigger) svg,.nav-dropdown-content .nav-dropdown-item-icon{color:currentColor!important}#navigation-items>ul:first-child>li>a.nav-anchor>div:first-child{background:rgb(255 255 255/.03)!important;border:1px solid var(--docs-dashboard-border)!important;color:var(--docs-dashboard-muted)!important;filter:none!important;box-shadow:none!important}#navigation-items>ul:first-child>li>a.nav-anchor{margin-bottom:.2rem!important}#navigation-items>ul:first-child>li>a.nav-anchor>div:first-child svg{background-color:var(--docs-dashboard-muted)!important}#navigation-items>ul:first-child>li>a.nav-anchor:hover>div:first-child{background:rgb(231 132 104/.14)!important;border-color:rgb(231 132 104/.35)!important;color:var(--docs-dashboard-accent)!important}#navigation-items>ul:first-child>li>a.nav-anchor:hover>div:first-child svg{background-color:var(--docs-dashboard-accent)!important}#sidebar .nav-dropdown-trigger{border:0!important;background:0 0!important;box-shadow:none!important;padding-left:.375rem}#sidebar .nav-dropdown-trigger:hover{background-color:rgb(0 0 0/.04)!important}.dark #sidebar .nav-dropdown-trigger:hover{background-color:rgb(255 255 255/.05)!important}#sidebar .nav-dropdown-trigger .nav-dropdown-item-icon,.nav-dropdown-content .nav-dropdown-item-icon{border:0!important;background:0 0!important;height:auto!important;width:auto!important;padding:0!important}.nav-dropdown-content .nav-dropdown-item-description{display:none!important}#sidebar .nav-anchor span{font-family:'Space Grotesk',Inter,ui-sans-serif,system-ui,sans-serif!important;font-size:13px;font-weight:500;letter-spacing:0;text-transform:none}#sidebar [class*=group]>:is(div, span, p),#sidebar p{color:var(--docs-dashboard-muted)!important}#sidebar [class*=font-medium]:has(svg),#sidebar [class*=font-semibold],#sidebar [class*=group]>:is(div, span, p):has(svg){color:var(--docs-dashboard-text)!important}body:has([data-product-guide-index]) #sidebar a.nav-anchor[href='/']{background:rgb(255 255 255/.1)!important;color:var(--docs-dashboard-text)!important;font-weight:600!important}body:has([data-product-guide-index]) #sidebar a.nav-anchor[href='/'] span{color:inherit!important}.dark body:has([data-product-guide-index]) #sidebar a.nav-anchor[href='/'] svg,body:has([data-product-guide-index]) #sidebar a.nav-anchor[href='/'] svg{background-color:var(--docs-dashboard-text)!important}.dark body:has([data-product-guide-index]) #sidebar a.nav-anchor[href='/']{color:var(--docs-dashboard-text)!important}:is(#content-area[data-current-path='/'], [data-current-path='/'] #content-area):has([data-product-guide-index]){background:0 0!important}:is(#content-area[data-current-path='/'], [data-current-path='/'] #content-area):has([data-product-guide-index])>div:first-child{background:0 0!important;padding-right:0!important;padding-bottom:0!important;padding-left:0!important}[data-product-guide-index] a:not(.product-guide-feature-card){background-color:var(--docs-dashboard-surface)!important;border:1px solid var(--docs-dashboard-border)!important;border-radius:0!important;box-shadow:none!important}.dark [data-product-guide-index] a:not(.product-guide-feature-card){background-color:var(--docs-dashboard-surface)!important}[data-product-guide-index] a:not(.product-guide-feature-card):hover{background-color:var(--docs-dashboard-surface-raised)!important;border-color:var(--docs-dashboard-border-strong)!important}[data-product-guide-index]{color:var(--docs-dashboard-text)!important}[data-product-guide-index] h1{font-size:2rem!important;font-weight:600!important;line-height:1.15!important}[data-product-guide-index] :is(p, span, div){letter-spacing:0!important}[data-product-guide-index] :is(p, span[class*='text-gray-600'], span[class*='text-gray-400']){color:var(--docs-dashboard-muted)!important}.product-guide-feature-card,.product-guide-feature-card>div{display:flex!important;flex-direction:column!important;justify-content:space-between!important}.product-guide-feature-card{grid-column:1/-1;min-height:260px;background:url(/images/sample-feature-light.png) center/cover no-repeat!important;border:1px solid var(--docs-dashboard-border)!important;border-radius:0!important;box-shadow:none!important;color:#fff!important}.product-guide-feature-card>div{flex:1}.product-guide-feature-card :is(h2, h3, p, span, svg){color:#fff!important}.product-guide-feature-card :is(svg, [class*='icon']){background-color:#fff!important;width:2em!important;height:2em!important;margin-top:2px}.product-guide-feature-card-title{font-size:1.2em;font-weight:500}.product-guide-feature-card :is(h2, h3, p, span, svg).product-guide-feature-card-description{font-size:1.05em;font-weight:400;color:rgb(var(--gray-50)/62.5%)!important}img.nav-logo{width:120px;max-width:120px;max-height:40px;height:auto;object-fit:contain}:is(.card, [class*='rounded-'], button, input, textarea, select, kbd, pre, code){border-radius:0!important}:is(input, textarea, select, [role='combobox']){background:var(--docs-dashboard-surface)!important;border-color:var(--docs-dashboard-border)!important;color:var(--docs-dashboard-text)!important}.card,:is(button, a)[class*=border],[data-component-part=card-content-container]{border-color:var(--docs-dashboard-border)!important;box-shadow:none!important}#content :is(.card, [data-component-part='card-content-container']){background-color:var(--docs-dashboard-surface)!important}#content a.card:hover,#content a:has(>[data-component-part=card-content-container]):hover [data-component-part=card-content-container]{background-color:var(--docs-dashboard-surface-raised)!important;border-color:var(--docs-dashboard-border-strong)!important}#content,#content-area{background:var(--docs-dashboard-bg)!important}#content :is(p, li, td, blockquote){color:var(--docs-dashboard-muted)}#content :is(h1, h2, h3, h4){color:var(--docs-dashboard-text)}#content a{text-decoration-color:rgb(231 132 104/.55);text-underline-offset:4px}"}],"page":{"pagePath":"learn/security/mcp-server-security","slug":"/learn/security/mcp-server-security","pageMetadata":{"title":"MCP Server Security","description":"Protect an MCP server from prompt injection, token theft, SSRF, command injection, session hijacking, excessive permissions, and supply-chain attacks.","href":"/learn/security/mcp-server-security"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Protect an MCP server from prompt injection, token theft, SSRF, command injection, session hijacking, excessive permissions, and supply-chain attacks.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,input:`input`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[_jsx(_components.strong,{children:_jsx(_components.a,{href:`https://modelcontextprotocol.io/docs/tutorials/security/security_best_practices`,children:`MCP server security`})}),` is the set of controls that protects an MCP server, its users, connected systems, and credentials from unauthorized access or misuse.`]}),`\n`,_jsx(_components.p,{children:`An MCP server sits between an AI application and external capabilities. It must handle traditional API risks plus AI-specific risks such as prompt injection, unsafe tool selection, and untrusted model output.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`User -> AI host -> MCP client -> MCP server -> External API or system`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` | |`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` untrusted security`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` content boundary`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`Security must be enforced by code and policy. A model’s decision to call a tool is never proof that the operation is safe or authorized.`}),`\n`,_jsx(Heading,{level:`2`,id:`start-with-a-threat-model`,children:`Start with a threat model`}),`\n`,_jsx(_components.p,{children:`Identify:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Who can connect to the server`}),`\n`,_jsx(_components.li,{children:`Which tools, resources, and prompts are exposed`}),`\n`,_jsx(_components.li,{children:`Which data crosses each trust boundary`}),`\n`,_jsx(_components.li,{children:`Which credentials the server can access`}),`\n`,_jsx(_components.li,{children:`Which operations create side effects`}),`\n`,_jsx(_components.li,{children:`Which systems the server can reach over the network`}),`\n`,_jsx(_components.li,{children:`What happens if the client, server, model, or upstream system is compromised`}),`\n`]}),`\n`,_jsx(_components.p,{children:`Classify each capability by impact:`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Risk level`}),_jsx(_components.th,{children:`Example`}),_jsx(_components.th,{children:`Expected controls`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Low`}),_jsx(_components.td,{children:`Read public documentation`}),_jsx(_components.td,{children:`Input limits and safe output handling`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Medium`}),_jsx(_components.td,{children:`Read a user’s private records`}),_jsx(_components.td,{children:`Authentication, authorization, audit logging`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`High`}),_jsx(_components.td,{children:`Send messages or change records`}),_jsx(_components.td,{children:`Least privilege, confirmation, idempotency controls`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Critical`}),_jsx(_components.td,{children:`Payments, deletion, admin access`}),_jsx(_components.td,{children:`Strong approval, step-up authorization, strict policy, detailed audit`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`main-mcp-security-risks`,children:`Main MCP security risks`}),`\n`,_jsx(Heading,{level:`3`,id:`prompt-injection`,children:`Prompt injection`}),`\n`,_jsx(_components.p,{children:`Instructions hidden in user input, documents, web pages, or tool results can manipulate the model into calling a tool or disclosing data.`}),`\n`,_jsx(_components.p,{children:`Treat all external content as untrusted. Do not let retrieved text override authorization policy. Require user confirmation for sensitive actions and validate the final tool arguments independently of the conversation.`}),`\n`,_jsx(Heading,{level:`3`,id:`tool-poisoning`,children:`Tool poisoning`}),`\n`,_jsx(_components.p,{children:`A malicious or compromised server can publish deceptive tool names or descriptions. A trusted server can also change behavior after a user approves it.`}),`\n`,_jsx(_components.p,{children:`Show users which server provides each tool. Review tool changes, pin trusted versions where possible, and monitor unexpected changes to names, schemas, or descriptions.`}),`\n`,_jsx(Heading,{level:`3`,id:`command-and-query-injection`,children:`Command and query injection`}),`\n`,_jsx(_components.p,{children:`Model-provided arguments can reach shells, SQL queries, file paths, templates, or downstream APIs.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Avoid shell execution when a library API exists.`}),`\n`,_jsx(_components.li,{children:`Use parameterized database queries.`}),`\n`,_jsx(_components.li,{children:`Resolve and restrict file paths.`}),`\n`,_jsx(_components.li,{children:`Allowlist hosts, operations, and values.`}),`\n`,_jsx(_components.li,{children:`Apply length, type, range, and format limits.`}),`\n`]}),`\n`,_jsx(_components.p,{children:`Never place untrusted text directly into a command string.`}),`\n`,_jsx(Heading,{level:`3`,id:`excessive-permissions`,children:`Excessive permissions`}),`\n`,_jsx(_components.p,{children:`A read-only tool does not need an administrator token. Broad credentials increase the impact of prompt injection, implementation bugs, and credential theft.`}),`\n`,_jsx(_components.p,{children:`Use separate identities and scopes for separate functions. Enforce permissions at the MCP server and again at the upstream system.`}),`\n`,_jsx(Heading,{level:`3`,id:`token-theft-and-token-passthrough`,children:`Token theft and token passthrough`}),`\n`,_jsx(_components.p,{children:`Access tokens are bearer credentials. Anyone who obtains one may be able to use it until it expires or is revoked.`}),`\n`,_jsx(_components.p,{children:`The official MCP security guidance prohibits accepting an MCP access token and forwarding it unchanged to an upstream API. The MCP server must validate that tokens are intended for itself. If it needs to access another protected service, it should use a separate, audience-appropriate credential or a secure token-exchange design.`}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`An upstream API credential explicitly provided for that API is not the same as an MCP access token. Keep the two credential purposes and audiences separate.`})}),`\n`,_jsx(Heading,{level:`3`,id:`server-side-request-forgery`,children:`Server-side request forgery`}),`\n`,_jsx(_components.p,{children:`Tools that fetch user-provided URLs can be abused to reach internal services, cloud metadata endpoints, or unauthorized hosts.`}),`\n`,_jsx(_components.p,{children:`Use strict URL parsing, allowlisted schemes and domains, DNS and IP checks, redirect validation, egress filtering, timeouts, and response-size limits.`}),`\n`,_jsx(Heading,{level:`3`,id:`session-hijacking`,children:`Session hijacking`}),`\n`,_jsx(_components.p,{children:`If a remote server uses sessions, an attacker who steals or predicts a session identifier may impersonate another connection or inject messages.`}),`\n`,_jsx(_components.p,{children:`Use cryptographically secure identifiers, bind session state to the authenticated identity, never use sessions as authentication, rotate or terminate them appropriately, and protect all traffic with TLS.`}),`\n`,_jsx(Heading,{level:`3`,id:`local-server-compromise`,children:`Local server compromise`}),`\n`,_jsxs(_components.p,{children:[`A local `,_jsx(_components.code,{children:`stdio`}),` server runs with the user’s operating-system permissions. A malicious package or server command may read files, environment variables, browser data, or developer credentials.`]}),`\n`,_jsx(_components.p,{children:`Install local servers only from trusted sources. Pin dependencies, inspect startup commands, minimize environment variables, sandbox processes, and restrict filesystem and network access.`}),`\n`,_jsx(Heading,{level:`2`,id:`secure-authentication-and-authorization`,children:`Secure authentication and authorization`}),`\n`,_jsx(_components.p,{children:`For a protected remote server:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Use HTTPS.`}),`\n`,_jsxs(_components.li,{children:[`Follow the MCP OAuth-based `,_jsx(_components.a,{href:`https://modelcontextprotocol.io/specification`,children:`authorization specification`}),`.`]}),`\n`,_jsx(_components.li,{children:`Validate token issuer, audience, expiry, signature, and required scopes.`}),`\n`,_jsx(_components.li,{children:`Use protected resource metadata for authorization-server discovery.`}),`\n`,_jsx(_components.li,{children:`Use PKCE for authorization code flows.`}),`\n`,_jsx(_components.li,{children:`Reject tokens not issued for the MCP server.`}),`\n`,_jsx(_components.li,{children:`Apply least privilege and incremental scope requests.`}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Read `,_jsx(_components.a,{href:`/learn/security/authentication`,children:`MCP authentication`}),` and `,_jsx(_components.a,{href:`/learn/security/authorization`,children:`MCP authorization`}),` for the distinction.`]}),`\n`,_jsx(Heading,{level:`2`,id:`secure-tools`,children:`Secure tools`}),`\n`,_jsx(_components.p,{children:`Every tool handler should:`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsx(_components.li,{children:`Authenticate the caller when required.`}),`\n`,_jsx(_components.li,{children:`Authorize the tool and target object.`}),`\n`,_jsx(_components.li,{children:`Validate the complete input schema.`}),`\n`,_jsx(_components.li,{children:`Apply business rules and state checks.`}),`\n`,_jsx(_components.li,{children:`Request confirmation for sensitive side effects.`}),`\n`,_jsx(_components.li,{children:`Call the upstream system with minimum privilege.`}),`\n`,_jsx(_components.li,{children:`Filter the result before returning it.`}),`\n`,_jsx(_components.li,{children:`Record a safe audit event.`}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Tool annotations such as `,_jsx(_components.code,{children:`readOnlyHint`}),` and `,_jsx(_components.code,{children:`destructiveHint`}),` are display hints. They are not enforceable security controls.`]}),`\n`,_jsx(Heading,{level:`2`,id:`secure-resources-and-prompts`,children:`Secure resources and prompts`}),`\n`,_jsxs(_components.p,{children:[`For `,_jsx(_components.a,{href:`/learn/core-concepts/resources`,children:`resources`}),`:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Authorize each URI, not only `,_jsx(_components.code,{children:`resources/list`}),`.`]}),`\n`,_jsx(_components.li,{children:`Prevent path traversal.`}),`\n`,_jsx(_components.li,{children:`Avoid exposing sensitive metadata in list responses.`}),`\n`,_jsx(_components.li,{children:`Limit resource size.`}),`\n`,_jsx(_components.li,{children:`Treat returned content as untrusted.`}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`For `,_jsx(_components.a,{href:`/learn/core-concepts/prompts`,children:`prompts`}),`:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Validate all arguments.`}),`\n`,_jsx(_components.li,{children:`Make generated messages visible when appropriate.`}),`\n`,_jsx(_components.li,{children:`Do not embed credentials.`}),`\n`,_jsx(_components.li,{children:`Prevent prompt templates from silently expanding access.`}),`\n`,_jsx(_components.li,{children:`Treat server-provided instructions as untrusted input to the host.`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`protect-secrets`,children:`Protect secrets`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Prefer a managed secret store or workload identity in production.`}),`\n`,_jsx(_components.li,{children:`Never commit secrets to source control.`}),`\n`,_jsx(_components.li,{children:`Do not place secrets in tool descriptions, arguments, URLs, or results.`}),`\n`,_jsx(_components.li,{children:`Redact authorization headers and API keys from logs.`}),`\n`,_jsx(_components.li,{children:`Rotate credentials after suspected exposure.`}),`\n`,_jsx(_components.li,{children:`Separate development, staging, and production credentials.`}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Read `,_jsx(_components.a,{href:`/learn/security/api-key-management`,children:`API key management`}),` for rotation and storage guidance.`]}),`\n`,_jsx(Heading,{level:`2`,id:`network-and-transport-controls`,children:`Network and transport controls`}),`\n`,_jsx(_components.p,{children:`For Streamable HTTP:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Validate the `,_jsx(_components.code,{children:`Origin`}),` header.`]}),`\n`,_jsx(_components.li,{children:`Use TLS and secure HTTP defaults.`}),`\n`,_jsx(_components.li,{children:`Bind local-only services to loopback.`}),`\n`,_jsx(_components.li,{children:`Limit request body and response sizes.`}),`\n`,_jsx(_components.li,{children:`Set connection and upstream timeouts.`}),`\n`,_jsx(_components.li,{children:`Apply rate and concurrency limits.`}),`\n`,_jsx(_components.li,{children:`Restrict outbound network access.`}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`For `,_jsx(_components.code,{children:`stdio`}),`:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Reserve `,_jsx(_components.code,{children:`stdout`}),` for MCP messages.`]}),`\n`,_jsxs(_components.li,{children:[`Send logs to `,_jsx(_components.code,{children:`stderr`}),`.`]}),`\n`,_jsx(_components.li,{children:`Pass only required environment variables.`}),`\n`,_jsx(_components.li,{children:`Use an explicit executable path.`}),`\n`,_jsx(_components.li,{children:`Avoid starting commands through an unnecessary shell.`}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`See `,_jsx(_components.a,{href:`/learn/core-concepts/transports`,children:`MCP transports`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`logging-and-incident-response`,children:`Logging and incident response`}),`\n`,_jsx(_components.p,{children:`Log:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Authenticated actor or service identity`}),`\n`,_jsx(_components.li,{children:`Tool or resource name`}),`\n`,_jsx(_components.li,{children:`Authorization decision`}),`\n`,_jsx(_components.li,{children:`Timestamp and request correlation ID`}),`\n`,_jsx(_components.li,{children:`Outcome, latency, and safe error category`}),`\n`,_jsx(_components.li,{children:`Administrative configuration changes`}),`\n`]}),`\n`,_jsx(_components.p,{children:`Do not log tokens, API keys, full authorization headers, or sensitive payloads.`}),`\n`,_jsx(_components.p,{children:`Prepare an incident process for revoking credentials, disabling tools, pausing the server, preserving audit data, notifying affected users, and restoring a reviewed version.`}),`\n`,_jsx(Heading,{level:`2`,id:`production-security-checklist`,children:`Production security checklist`}),`\n`,_jsxs(_components.ul,{className:`contains-task-list`,children:[`\n`,_jsxs(_components.li,{className:`task-list-item`,children:[_jsx(_components.input,{type:`checkbox`,disabled:true}),` `,`Threat model completed`]}),`\n`,_jsxs(_components.li,{className:`task-list-item`,children:[_jsx(_components.input,{type:`checkbox`,disabled:true}),` `,`Only required capabilities exposed`]}),`\n`,_jsxs(_components.li,{className:`task-list-item`,children:[_jsx(_components.input,{type:`checkbox`,disabled:true}),` `,`Authentication and authorization tested`]}),`\n`,_jsxs(_components.li,{className:`task-list-item`,children:[_jsx(_components.input,{type:`checkbox`,disabled:true}),` `,`Token audiences and scopes validated`]}),`\n`,_jsxs(_components.li,{className:`task-list-item`,children:[_jsx(_components.input,{type:`checkbox`,disabled:true}),` `,`Input and output limits enforced`]}),`\n`,_jsxs(_components.li,{className:`task-list-item`,children:[_jsx(_components.input,{type:`checkbox`,disabled:true}),` `,`Sensitive actions require confirmation`]}),`\n`,_jsxs(_components.li,{className:`task-list-item`,children:[_jsx(_components.input,{type:`checkbox`,disabled:true}),` `,`SSRF and injection protections applied`]}),`\n`,_jsxs(_components.li,{className:`task-list-item`,children:[_jsx(_components.input,{type:`checkbox`,disabled:true}),` `,`Secrets stored and rotated safely`]}),`\n`,_jsxs(_components.li,{className:`task-list-item`,children:[_jsx(_components.input,{type:`checkbox`,disabled:true}),` `,`Dependencies scanned and pinned`]}),`\n`,_jsxs(_components.li,{className:`task-list-item`,children:[_jsx(_components.input,{type:`checkbox`,disabled:true}),` `,`Logs exclude credentials and payload secrets`]}),`\n`,_jsxs(_components.li,{className:`task-list-item`,children:[_jsx(_components.input,{type:`checkbox`,disabled:true}),` `,`Rate limits and timeouts configured`]}),`\n`,_jsxs(_components.li,{className:`task-list-item`,children:[_jsx(_components.input,{type:`checkbox`,disabled:true}),` `,`Incident and rollback procedures tested`]}),`\n`,_jsxs(_components.li,{className:`task-list-item`,children:[_jsx(_components.input,{type:`checkbox`,disabled:true}),` `,`Server tested with multiple MCP clients`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`key-takeaway`,children:`Key takeaway`}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`A secure MCP server treats the model, client input, server metadata, retrieved content, and upstream responses as untrusted while enforcing identity, permission, validation, and least privilege at every boundary.`})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"MCP Server Security","description":"Protect an MCP server from prompt injection, token theft, SSRF, command injection, session hijacking, excessive permissions, and supply-chain attacks.","href":"/learn/security/mcp-server-security"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Start with a threat model","slug":"start-with-a-threat-model","depth":2,"children":[]},{"title":"Main MCP security risks","slug":"main-mcp-security-risks","depth":2,"children":[{"title":"Prompt injection","slug":"prompt-injection","depth":3,"children":[]},{"title":"Tool poisoning","slug":"tool-poisoning","depth":3,"children":[]},{"title":"Command and query injection","slug":"command-and-query-injection","depth":3,"children":[]},{"title":"Excessive permissions","slug":"excessive-permissions","depth":3,"children":[]},{"title":"Token theft and token passthrough","slug":"token-theft-and-token-passthrough","depth":3,"children":[]},{"title":"Server-side request forgery","slug":"server-side-request-forgery","depth":3,"children":[]},{"title":"Session hijacking","slug":"session-hijacking","depth":3,"children":[]},{"title":"Local server compromise","slug":"local-server-compromise","depth":3,"children":[]}]},{"title":"Secure authentication and authorization","slug":"secure-authentication-and-authorization","depth":2,"children":[]},{"title":"Secure tools","slug":"secure-tools","depth":2,"children":[]},{"title":"Secure resources and prompts","slug":"secure-resources-and-prompts","depth":2,"children":[]},{"title":"Protect secrets","slug":"protect-secrets","depth":2,"children":[]},{"title":"Network and transport controls","slug":"network-and-transport-controls","depth":2,"children":[]},{"title":"Logging and incident response","slug":"logging-and-incident-response","depth":2,"children":[]},{"title":"Production security checklist","slug":"production-security-checklist","depth":2,"children":[]},{"title":"Key takeaway","slug":"key-takeaway","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"0mcp","siteName":"0mcp","title":"MCP Server Security - 0mcp","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-08-03T05:44:20.461Z","originalFileLocation":"learn/security/mcp-server-security.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=\"dark\";if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Protect an MCP server from prompt injection, token theft, SSRF, command injection, session hijacking, excessive permissions, and supply-chain attacks.\">\u003cmeta data-mint-head name=\"application-name\" content=\"0mcp\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/0mcp/mSqqq78mYLc8FuRB/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/0mcp/mSqqq78mYLc8FuRB/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/0mcp/mSqqq78mYLc8FuRB/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/0mcp/mSqqq78mYLc8FuRB/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/0mcp/mSqqq78mYLc8FuRB/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/0mcp/mSqqq78mYLc8FuRB/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/0mcp/mSqqq78mYLc8FuRB/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/0mcp/mSqqq78mYLc8FuRB/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/0mcp/mSqqq78mYLc8FuRB/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"MCP Server Security - 0mcp\">\u003cmeta data-mint-head property=\"og:description\" content=\"Protect an MCP server from prompt injection, token theft, SSRF, command injection, session hijacking, excessive permissions, and supply-chain attacks.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"0mcp\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.0mcp.io/learn/security/mcp-server-security\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://0mcp.mintlify.app/_mintlify/api/og/v2?division=MCP+Security\u0026amp;title=MCP+Server+Security\u0026amp;description=Protect+an+MCP+server+from+prompt+injection%2C+token+theft%2C+SSRF%2C+command+injection%2C+session+hijacking%2C+excessive+permissions%2C+and+supply-chain+attacks.\u0026amp;theme=52af35900aee7951d12e3584\u0026amp;signature=f5b20b7cc473ceee4775f32fa2ff82fef98bcd8e127264aeb4da6692191b8e8f\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"MCP Server Security - 0mcp\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Protect an MCP server from prompt injection, token theft, SSRF, command injection, session hijacking, excessive permissions, and supply-chain attacks.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://0mcp.mintlify.app/_mintlify/api/og/v2?division=MCP+Security\u0026amp;title=MCP+Server+Security\u0026amp;description=Protect+an+MCP+server+from+prompt+injection%2C+token+theft%2C+SSRF%2C+command+injection%2C+session+hijacking%2C+excessive+permissions%2C+and+supply-chain+attacks.\u0026amp;theme=52af35900aee7951d12e3584\u0026amp;signature=f5b20b7cc473ceee4775f32fa2ff82fef98bcd8e127264aeb4da6692191b8e8f\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/0mcp/mSqqq78mYLc8FuRB/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"0mcp\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#E78468\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.0mcp.io/learn/security/mcp-server-security\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/learn/security/mcp-server-security.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.0mcp.io/#organization\",\"name\":\"0mcp\",\"url\":\"https://docs.0mcp.io\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/0mcp/edbyRvIT5oXg-bmk/logo/light.svg?fit=max\u0026auto=format\u0026n=edbyRvIT5oXg-bmk\u0026q=85\u0026s=47de7cdcf15a79f5ed16caffaaad0def\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.0mcp.io#website\",\"name\":\"0mcp\",\"url\":\"https://docs.0mcp.io\",\"publisher\":{\"@id\":\"https://docs.0mcp.io/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.0mcp.io/learn/security/mcp-server-security#webpage\",\"url\":\"https://docs.0mcp.io/learn/security/mcp-server-security\",\"name\":\"MCP Server Security\",\"description\":\"Protect an MCP server from prompt injection, token theft, SSRF, command injection, session hijacking, excessive permissions, and supply-chain attacks.\",\"dateModified\":\"2026-08-03T05:44:20.461Z\",\"isPartOf\":{\"@id\":\"https://docs.0mcp.io#website\"},\"breadcrumb\":{\"@id\":\"https://docs.0mcp.io/learn/security/mcp-server-security#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.0mcp.io/learn/security/mcp-server-security#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"0mcp\",\"item\":\"https://docs.0mcp.io\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"MCP Server Security\",\"item\":\"https://docs.0mcp.io/learn/security/mcp-server-security\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.0mcp.io/learn/security/mcp-server-security#article\",\"headline\":\"MCP Server Security\",\"name\":\"MCP Server Security\",\"description\":\"Protect an MCP server from prompt injection, token theft, SSRF, command injection, session hijacking, excessive permissions, and supply-chain attacks.\",\"url\":\"https://docs.0mcp.io/learn/security/mcp-server-security\",\"mainEntityOfPage\":{\"@id\":\"https://docs.0mcp.io/learn/security/mcp-server-security#webpage\"},\"dateModified\":\"2026-08-03T05:44:20.461Z\",\"publisher\":{\"@id\":\"https://docs.0mcp.io/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.0mcp.io#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"0mcp\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"0mcp","nav":{"global":null,"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":""}]},{"tab":"Learn MCP","pages":[{"group":"Fundamentals","icon":"book-open","pages":[{"title":"What is MCP?","href":"/learn/fundamentals/what-is-mcp"},{"title":"Why MCP matters?","href":"/learn/fundamentals/why-mcp-matters"},{"title":"How MCP works?","href":"/learn/fundamentals/how-mcp-works"},{"title":"MCP architecture explained","href":"/learn/fundamentals/mcp-architecture-explained"},{"title":"Remote MCP servers","href":"/learn/fundamentals/remote-mcp-servers"},{"title":"Local MCP servers","href":"/learn/fundamentals/local-mcp-servers"},{"title":"Local vs remote MCP: Which should you choose?","href":"/learn/fundamentals/local-vs-remote-mcp"},{"title":"The MCP specification explained","href":"/learn/fundamentals/mcp-specification-explained"},{"title":"Custom MCP transport implementation","href":"/learn/fundamentals/custom-mcp-transport"},{"title":"Deploying an MCP server on Kubernetes","href":"/learn/fundamentals/mcp-server-on-kubernetes"},{"title":"How to use Claude with MCP","href":"/learn/fundamentals/using-claude-with-mcp"},{"title":"MCP vs traditional AI SDKs: What builders should know","href":"/learn/fundamentals/mcp-vs-traditional-sdks"},{"title":"Comparing MCP SDKs: Python vs TypeScript vs Go","href":"/learn/fundamentals/mcp-sdk-comparison"},{"title":"MCP Inspector: A guide to testing and debugging","href":"/learn/fundamentals/mcp-inspector-guide"},{"title":"RAG vs MCP: Differences and when to combine them","href":"/learn/fundamentals/rag-vs-mcp"}]},{"group":"MCP Core Concepts","icon":"blocks","pages":[{"title":"Hosts, clients, and servers in MCP","href":"/learn/core-concepts/hosts-clients-servers"},{"title":"Tools","href":"/learn/core-concepts/tools"},{"title":"Resources","href":"/learn/core-concepts/resources"},{"title":"Prompts","href":"/learn/core-concepts/prompts"},{"title":"Sampling","href":"/learn/core-concepts/sampling"},{"title":"Transports","href":"/learn/core-concepts/transports"}]},{"group":"Build MCP Server","icon":"hammer","pages":[{"title":"Turning OpenAPI specs into MCP servers","href":"/learn/build/openapi-to-mcp-server"},{"title":"From REST API to MCP server: A migration guide","href":"/learn/build/rest-api-to-mcp-server"},{"title":"MCP server generators: Tools compared","href":"/learn/build/mcp-server-generators"},{"title":"The MCP TypeScript SDK: Building clients and servers","href":"/learn/build/typescript-sdk"},{"title":"The MCP Python SDK: Building clients and servers","href":"/learn/build/python-sdk"},{"title":"How the MCP ecosystem is evolving","description":"Understand how MCP is evolving across remote deployment, discovery, SDKs, extensions, governance, security, and production agent workflows.","href":"/learn/build/mcp-ecosystem-evolution"}]},{"group":"MCP Security","icon":"shield-check","pages":[{"title":"MCP Server Security","href":"/learn/security/mcp-server-security"},{"title":"MCP authentication","description":"Understand identity and credential verification in MCP, including remote OAuth access, local server credentials, and upstream API authentication.","href":"/learn/security/authentication"},{"title":"MCP authorization","href":"/learn/security/authorization"},{"title":"API key management best practices for MCP servers","href":"/learn/security/api-key-management"}]},{"group":"MCP Best Practices","icon":"list-checks","pages":[{"title":"Real-time monitoring and logging for MCP servers","href":"/learn/best-practices/monitoring-and-logging"},{"title":"How to test an MCP server","href":"/learn/best-practices/how-to-test-mcp-servers"},{"title":"Error handling and debugging for MCP servers","href":"/learn/best-practices/error-handling-and-debugging"},{"title":"MCP API documentation guide","href":"/learn/best-practices/api-documentation-guide"},{"title":"MCP server configuration best practices","href":"/learn/best-practices/server-configuration"},{"title":"MCP server prompting guide","href":"/learn/best-practices/server-prompting-guide"},{"title":"10 useful MCP servers for developers","href":"/learn/best-practices/best-mcp-servers"},{"title":"MCP streaming performance and transport trade-offs","href":"/learn/best-practices/streaming-performance-tradeoffs"},{"title":"MCP server architecture for API providers","href":"/learn/best-practices/architecture-for-api-providers"}]}]}]},"basePath":"","title":"MCP Server Security - 0mcp","buildId":"dpl_36EDyZCDfRuoUD9af5CH4M1bqY2h","deploymentId":"dpl_36EDyZCDfRuoUD9af5CH4M1bqY2h","dynamics":[],"chunks":[]}