Azure-Samples/remote-mcp-functions-python
Getting Started with Remote MCP Servers using Azure Functions (Python)
d6d67a38ac9dPaths from tool input into commands, SQL, files and URLs
How much power the tools give an agent over the machine
Hidden instructions and poisoning in text for the model
Known vulnerabilities in the packages the server uses
How the server reads credentials and where they can go
Whether the tools do only what their descriptions say
Top risks in plain words
- HIGHTool
get_website_previewrequests any address by design: an agent steered by prompt injection can use it that way.
How to use it safely
Practical steps from what we found in this server. They lower the risk; they do not replace a review of the code.
- Limit where it can connect
get_website_previewcan request any address. Block access to internal hosts and cloud metadata endpoints. - Turn off the tools you do not use
Most MCP clients let you disable single tools. If you do not need
get_website_preview, switch them off. - Give it a narrowly scoped token
Its code reads credentials or environment variables. Use a key limited to what this server needs, not your main one.
- Keep confirmations on
Leave your MCP client's confirmation prompt on for tools that change files, run commands or send data.
What its tools can do on your machine
The server offers 12 tools. When an AI agent calls them, this is what their code can do on the machine where the server runs, as traced in the source. Tools that call code the scanner could not follow may do more.
get_weatherhello_tool_with_authbatch_save_snippets, hello_tool_with_authhello_tool_with_authNo tool was seen to: start other programs on the machine; connect to the internet or other hosts.
Where its requests and secrets go
Read from the names along each tool's calls, not from a run: what the code says, not every address it may reach at run time.
The literal addresses the tools' requests name.
- None: no request names a fixed host.
Constants or settings that start an address; the value comes from configuration.
- None seen.
Credential-like environment variables. Give the server a key with the least access it needs.
- None: no credential-like variable is read by the tools.
Text it brings in from outside
Text that reaches the model from outside: an instruction hidden in it can steer the agent (prompt injection). Treat what these tools return as data, not as orders.
- files1 tool · get_weather
Not all three are present in the tools the scanner traced.
Tool annotations
No tool declares MCP annotations (readOnlyHint, destructiveHint and the rest). Clients use them to decide what to confirm; directories such as Anthropic's and OpenAI's ask for them.
Tools, prompts and resources (12: 12 tools)
Open a row for its full description. Chips show what its code can reach, and which risky capability its own description declares.
get_website_previewtool Demonstrates returning TextContentBlock and ResourceLinkBlock together. Fetches basic metadata from a URL and returns it with a resource link.Requests any address
Demonstrates returning TextContentBlock and ResourceLinkBlock together. Fetches basic metadata from a URL and returns it with a resource link.
batch_save_snippetstool Demonstrates batch tool inputs - saving multiple snippets in one operation.Env vars
Demonstrates batch tool inputs - saving multiple snippets in one operation.
Accepts an array of snippet objects and saves each one to blob storage.
This pattern is useful for bulk operations and reduces the number of
tool invocations needed.
Uses managed identity when deployed to Azure, falls back to connection
string for local development with Azurite.
Args:
snippet_items: List of dicts with 'name' and 'content' keys (or JSON string)
Returns:
JSON string with summary of saved snippetsgenerate_badgetool Demonstrates returning multiple content blocks (List[ContentBlock]). Generates an SVG status badge and returns it alongside a text description.
Demonstrates returning multiple content blocks (List[ContentBlock]). Generates an SVG status badge and returns it alongside a text description.
generate_qr_codetool Demonstrates returning a single ImageContentBlock. Generates a QR code PNG and returns it as a base64-encoded image.
Demonstrates returning a single ImageContentBlock. Generates a QR code PNG and returns it as a base64-encoded image.
get_snippettool Retrieve a snippet by name from Azure Blob Storage.
Retrieve a snippet by name from Azure Blob Storage.
get_snippet_with_metadatatool Demonstrates returning both content blocks and structured metadata via CallToolResult.
Demonstrates returning both content blocks and structured metadata via CallToolResult.
Returns a CallToolResult with:
- content: List of ContentBlock objects (for backward compatibility)
- structured_content: JSON metadata (for clients that support it)
This pattern allows clients to choose between simple text content or
richer structured data depending on their capabilities.get_weathertool Returns current weather for a location via Open-Meteo.Filesoutside text
Returns current weather for a location via Open-Meteo.
hello_mcptool Hello world.
Hello world.
hello_tool_with_authtool Greets the signed-in user by name using the On-Behalf-Of (OBO) flow to call Microsoft Graph.CredentialsEnv varsSensitive paths
Greets the signed-in user by name using the On-Behalf-Of (OBO) flow to call Microsoft Graph.
In production (with built-in MCP auth), the user's
token arrives via HTTP headers. This tool exchanges that token for a Graph
token using the OBO flow, then calls Graph's /me endpoint as that user.
In local development, falls back to the developer's local identity
(az login, VS Code, etc.).save_snippettool Save a snippet with a name to Azure Blob Storage.
Save a snippet with a name to Azure Blob Storage.
save_snippettool Save a snippet with a name to Azure Blob Storage.
Save a snippet with a name to Azure Blob Storage.
save_snippet_structuredtool Demonstrates returning a structured data class (Snippet POCO equivalent).
Demonstrates returning a structured data class (Snippet POCO equivalent).
When a dataclass is returned, it's automatically serialized as structured
content, providing type information and documentation to MCP clients.
This is the Python equivalent of the .NET [McpContent] pattern.
Args:
name: The snippet name
content: The snippet content
Returns:
Snippet dataclass instanceText the model reads (12)
Every tool, prompt and resource description as written in the code: the model sees all of it, the user usually does not.
save_snippet tool
Save a snippet with a name to Azure Blob Storage.
hello_mcp tool
Hello world.
get_snippet tool
Retrieve a snippet by name from Azure Blob Storage.
save_snippet tool
Save a snippet with a name to Azure Blob Storage.
generate_qr_code tool
Demonstrates returning a single ImageContentBlock. Generates a QR code PNG and returns it as a base64-encoded image.
generate_badge tool
Demonstrates returning multiple content blocks (List[ContentBlock]). Generates an SVG status badge and returns it alongside a text description.
get_website_preview tool
Demonstrates returning TextContentBlock and ResourceLinkBlock together. Fetches basic metadata from a URL and returns it with a resource link.
get_snippet_with_metadata tool
Demonstrates returning both content blocks and structured metadata via CallToolResult.
Returns a CallToolResult with:
- content: List of ContentBlock objects (for backward compatibility)
- structured_content: JSON metadata (for clients that support it)
This pattern allows clients to choose between simple text content or
richer structured data depending on their capabilities.batch_save_snippets tool
Demonstrates batch tool inputs - saving multiple snippets in one operation.
Accepts an array of snippet objects and saves each one to blob storage.
This pattern is useful for bulk operations and reduces the number of
tool invocations needed.
Uses managed identity when deployed to Azure, falls back to connection
string for local development with Azurite.
Args:
snippet_items: List of dicts with 'name' and 'content' keys (or JSON string)
Returns:
JSON string with summary of saved snippetssave_snippet_structured tool
Demonstrates returning a structured data class (Snippet POCO equivalent).
When a dataclass is returned, it's automatically serialized as structured
content, providing type information and documentation to MCP clients.
This is the Python equivalent of the .NET [McpContent] pattern.
Args:
name: The snippet name
content: The snippet content
Returns:
Snippet dataclass instancehello_tool_with_auth tool
Greets the signed-in user by name using the On-Behalf-Of (OBO) flow to call Microsoft Graph.
In production (with built-in MCP auth), the user's
token arrives via HTTP headers. This tool exchanges that token for a Graph
token using the OBO flow, then calls Graph's /me endpoint as that user.
In local development, falls back to the developer's local identity
(az login, VS Code, etc.).get_weather tool
Returns current weather for a location via Open-Meteo.
What we checked
The same checks run on every server. Each line below has one of these marks:
- 8 checks: command injection, argument injection, path traversal, server-side request forgery, SQL injection, code execution, unsafe deserialization, template injectionChecked on every scan. Results in this category are published only after a person has verified them.
- Runs programs the caller choosesNo tool runs a command or program the caller supplies — 12 tool handlers traced
- Executes caller-supplied codeNo tool evaluates code the caller supplies — 12 tool handlers traced
- Reads or writes any file pathNo tool works on a file path the caller supplies without a root check — 12 tool handlers traced
- Requests any address HIGH1 finding in get_website_preview
- Runs caller-supplied SQLNo tool executes a query the caller supplies — 12 tool handlers traced
- Tools that start processesNot seen in the traced code of 12 capabilities; 11 more call code the scanner could not follow, where it may happen
- Tools that touch files1 of 12 capabilities touch files; 10 more call code the scanner could not follow, where it may happen
- Tools that call the networkNot seen in the traced code of 12 capabilities; 11 more call code the scanner could not follow, where it may happen
Where the code is: 12 handlers in 4 files at commit d6d67a38ac9d
src/FunctionsMcpResources/function_app.pysave_snippetsrc/FunctionsMcpTool/function_app.pyhello_mcp, get_snippet, save_snippet, generate_qr_code, generate_badge, get_website_preview, get_snippet_with_metadata, batch_save_snippets, save_snippet_structuredsrc/FunctionsMcpTool/hello_tool_with_auth.pyhello_tool_with_authsrc/McpWeatherApp/function_app.pyget_weather
- 5 checks: tool poisoning, instruction override, hidden content, exfiltration requests, metadata integrityChecked on every scan. Results in this category are published only after a person has verified them.
- Dependency manifests6 manifests: pyproject.toml, src/FunctionsMcpPrompts/requirements.txt, src/FunctionsMcpResources/requirements.txt, src/FunctionsMcpTool/requirements.txt, src/McpWeatherApp/app/package.json
- Lockfiles checked against OSV4 files resolved and checked against the OSV database; 6 not resolved: pyproject.toml: dependency ranges declared here were not resolved against a lockfile and were not checked; src/FunctionsMcpPrompts/requirements.txt: 1 dependency line carries no exact version, so the installed version was not checked; pin them or add a lockfile
- Known vulnerabilities in production dependenciesNo production dependency with a known advisory
- Known vulnerabilities in other dependenciesNo package used only for development, tests or examples has a known advisory
- MCP SDK versionmcp , @modelcontextprotocol/ext-apps ^1.0.0
- 3 checks: credential harvesting, undeclared credential access, credentials sent over the networkChecked on every scan. Results in this category are published only after a person has verified them.
- Tools that read credentials1 of 12 capabilities read credentials; 10 more call code the scanner could not follow, where it may happen
- Environment variables2 capabilities read environment variables (often API keys)
- Authentication declaredNot checked: needs the live server's tools/list (a remote server declares how clients authenticate)
- 3 checks: undeclared network access, undeclared file access, undeclared process executionChecked on every scan. Results in this category are published only after a person has verified them.
- Tool descriptions presentEvery tool has a description the model and the user can read
- Statically known namesEvery tool's name could be read from the code
- Input schemasNot checked: needs the live server's tools/list (every tool declares an input schema)
- Destructive tools annotatedNot checked: needs the live server's tools/list (tools that write, delete or run commands carry destructivehint)
Dependencies with known vulnerabilities (0 in production)
Dependency ranges were not resolved against a lockfile, so the score is capped at 7.
No known vulnerabilities in the production dependencies that could be checked.
Past security advisories
Vulnerabilities published for this server itself, from the GitHub Advisory Database.
No security advisories have been published for this server in the GitHub Advisory Database.
How it runs
| Where it runs | On your machine, started by your MCP client from this repository or its package |
|---|---|
| Transport | not stated in the code the scanner read; most local servers talk over stdio |
| Sign-in | not checked needs the live server |
| MCP SDK | mcp , @modelcontextprotocol/ext-apps ^1.0.0 |
The project's own security
| Security policy | none no SECURITY.md in the repository: report issues privately through GitHub if it is enabled |
|---|---|
| Past advisories | none in the GitHub Advisory Database |
| Last push | 2026-10-13 |
| Signed releases | not checked yet |
Where it is published
| Listed in | 1 catalog (github_search) |
|---|---|
| License | MIT |
| Created | 2025-04-03 |
| Topics | azure-functions azure-functions-python mcp mcp-server |
Attack map
How the server is built and where its risky tools lead: servers, their tools, what the tools' code can do, and the traced route from a declared risky tool's argument to the operation it reaches. Click a node for details.