aws-samples/sample-building-mcp-servers-with-rust
This project provides sample MCP servers that can be used with Amazon Q CLI or other MCP-compatible AI assistants
4b65e9b1cec6mcp-sample0.1.0 in Cargo.tomlPaths 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
How far the analysis went
The scanner traces each tool from its input to the operations its code performs, and here it could not follow every path. Code Safety is shown as partly traced instead of a score: no finding there is not a clean result. The score of Capability Exposure counts only what it could follow.
- In 2 places a tool's input is handed to a function whose name matches several definitions in the code; the scanner could not tell which one runs, so it stopped there
- 4 source files could be read only in part
Top risks in plain words
- HIGHTools
get_table_schema,list_tables,queryrun SQL by design: an agent steered by prompt injection can use them that way. - HIGH19 production dependencies have known vulnerabilities (worst: high).
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.
- Connect it with a read-only database user
get_table_schema,list_tables,querycan run any query it is given. - Turn off the tools you do not use
Most MCP clients let you disable single tools. If you do not need
get_table_schema,list_tables,query, switch them off. - Update its vulnerable packages
Use
anyhow1.0.103 or later,aws-smithy-json0.62.7 or later,bytes1.11.1 or later,h20.4.16 or later and 11 more. - 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 7 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.
None of the tools reaches any of these in the code the scanner could trace.
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
No tool was seen returning text from outside the server to the model.
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 (7: 7 tools)
Open a row for its full description. Chips show what its code can reach, and which risky capability its own description declares.
get_table_schematool Get schema for a specific tableRuns SQL
Get schema for a specific table
list_tablestool List tables in the PostgreSQL databaseRuns SQL
List tables in the PostgreSQL database
querytool Run a read-only SQL queryRuns SQL
Run a read-only SQL query
list_bucketstool List S3 buckets in a region
List S3 buckets in a region
list_instancestool List RDS instances in a region
List RDS instances in a region
subtool Calculate the difference of two numbers
Calculate the difference of two numbers
sumtool Calculate the sum of two numbers
Calculate the sum of two numbers
Text the model reads (7)
Every tool, prompt and resource description as written in the code: the model sees all of it, the user usually does not.
sum tool
Calculate the sum of two numbers
sub tool
Calculate the difference of two numbers
list_tables tool
List tables in the PostgreSQL database
get_table_schema tool
Get schema for a specific table
query tool
Run a read-only SQL query
list_instances tool
List RDS instances in a region
list_buckets tool
List S3 buckets in a region
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 — 7 tool handlers traced. Not every path could be followed, so this is not a clean pass.
- Executes caller-supplied codeNo tool evaluates code the caller supplies — 7 tool handlers traced. Not every path could be followed, so this is not a clean pass.
- Reads or writes any file pathNo tool works on a file path the caller supplies without a root check — 7 tool handlers traced. Not every path could be followed, so this is not a clean pass.
- Requests any addressNo tool sends a request to an address the caller supplies — 7 tool handlers traced. Not every path could be followed, so this is not a clean pass.
- Runs caller-supplied SQL1 finding the scanner could not decide; see the findings below
- Tools that start processesNot seen in the traced code of 7 capabilities; 7 more call code the scanner could not follow, where it may happen
- Tools that touch filesNot seen in the traced code of 7 capabilities; 7 more call code the scanner could not follow, where it may happen
- Tools that call the networkNot seen in the traced code of 7 capabilities; 7 more call code the scanner could not follow, where it may happen
Where the code is: 7 handlers in 4 files at commit 4b65e9b1cec6
- 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 manifests1 manifest: Cargo.toml
- Lockfiles checked against OSV1 file resolved and checked against the OSV database
- Known vulnerabilities in production dependencies HIGH19 production packages with known advisories
- Known vulnerabilities in other dependencies4 packages with advisories used only for development, tests or examples; an install of the server leaves them out
- MCP SDK versionNo MCP SDK declared in a manifest
- 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 credentialsNot seen in the traced code of 7 capabilities; 7 more call code the scanner could not follow, where it may happen
- 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 (19 in production)
rustls-webpkicrates.io 0.101.7 HIGH 7 advisories 0.103.120.103.130.103.16+3 more
- HIGHGHSA-82j2-j2ch-gfr8 CVE-2026-93599 RUSTSEC-2026-0104rustls-webpki: Denial of service via panic on malformed CRL BIT STRING
- MEDIUMRUSTSEC-2026-0098 CVE-2026-93600 GHSA-965h-392x-2mh5Name constraints for URI names were incorrectly accepted
- MEDIUMRUSTSEC-2026-0099 CVE-2026-93601 GHSA-xgp8-3hg3-c2mhName constraints were accepted for certificates asserting a wildcard name
- MEDIUMRUSTSEC-2026-0104 CVE-2026-93599 GHSA-82j2-j2ch-gfr8Reachable panic in certificate revocation list parsing
- MEDIUMRUSTSEC-2026-0382 BIT-golang-2026-111943 CVE-2026-111943 GO-2026-6809 RUSTSEC-2026-0381 RUSTSEC-2026-0383Certificate verification may accept distrusted intermediates
- LOWGHSA-xgp8-3hg3-c2mh CVE-2026-93601 RUSTSEC-2026-0099webpki: Name constraints were accepted for certificates asserting a wildcard name
- LOWGHSA-965h-392x-2mh5 CVE-2026-93600 RUSTSEC-2026-0098webpki: Name constraints for URI names were incorrectly accepted
rmcpcrates.io 0.1.5 HIGH 6 advisories 1.4.02.0.02.1.0
- HIGHGHSA-33f5-2c5q-wgwj CVE-2026-63127RMCP: Missing Resource Field Validation in OAuth Protected Resource Metadata Discovery
- HIGHGHSA-9pj6-vhgr-3mwh CVE-2026-63128RMCP: Unauthenticated permanent session-table leak in rmcp Streamable HTTP server transport leads to remote denial-of-service
- HIGHGHSA-89vp-x53w-74fx CVE-2026-42559 GHSA-fvh2-gm75-j4j7 RUSTSEC-2026-0140 RUSTSEC-2026-0189rmcp Streamable HTTP server transport has a DNS rebinding vulnerability
- MEDIUMGHSA-c9xm-49cp-xcr9rmcp OAuth client fetches server-controlled resource_metadata URLs
- MEDIUMRUSTSEC-2026-0189 CVE-2026-42559 GHSA-89vp-x53w-74fx GHSA-fvh2-gm75-j4j7 RUSTSEC-2026-0140DNS rebinding vulnerability in rmcp Streamable HTTP server transport
- MEDIUMGHSA-9g45-5xwm-f3wc CVE-2026-64684RMCP: Custom HTTP headers leak to cross-origin redirect targets
postgres-protocolcrates.io 0.6.8 HIGH 4 advisories 0.6.12
- HIGHGHSA-5x78-73v4-xg6w RUSTSEC-2026-0179postgres-protocol: Unbounded SCRAM iteration count allows a malicious server to cause CPU-exhaustion denial of service
- MEDIUMGHSA-rgqc-3x5p-6gwg RUSTSEC-2026-0180postgres-protocol: Panic decoding a malformed `hstore` value allows denial of service
- MEDIUMRUSTSEC-2026-0179 GHSA-5x78-73v4-xg6wUnbounded SCRAM iteration count allows a malicious server to cause CPU-exhaustion denial of service
- MEDIUMRUSTSEC-2026-0180 GHSA-rgqc-3x5p-6gwgPanic decoding a malformed `hstore` value allows denial of service
aws-smithy-jsoncrates.io 0.56.1 HIGH 1 advisory 0.62.7
- HIGHGHSA-8ffr-xgwf-xj56 CVE-2026-18140aws-smithy-json: Uncontrolled recursion in the aws-smithy-json unknown-key skip path allows unauthenticated remote denial of service in smithy-rs generated servers
rustlscrates.io 0.21.12 MEDIUM 5 advisories 0.23.460.24.0-dev.2
- MEDIUMRUSTSEC-2026-0346 CVE-2026-123609 GHSA-c8m5-c952-6cm4`Debug` impls for client session values expose TLS secrets
- MEDIUMRUSTSEC-2026-0349 CVE-2026-123611 GHSA-w44r-93j7-qv28Unauthenticated ServerHello can downgrade later connections to classical key exchange
- MEDIUMGHSA-c8m5-c952-6cm4 CVE-2026-123609 RUSTSEC-2026-0346Rustls: Session Debug formatting exposes TLS master secrets and resumption PSKs
- LOWGHSA-w44r-93j7-qv28 CVE-2026-123611 RUSTSEC-2026-0349rustls: An unauthenticated ServerHello poisons the per-name key-exchange record, so later ClientHellos carry only a classical X25519 share
- LOWGHSA-h2v8-394m-p7vv CVE-2026-123610 RUSTSEC-2026-0348Rustls: Brotli certificate decompression can allocate an attacker-controlled amount of memory up to 1 GiB before authentication.
ringcrates.io 0.16.20 MEDIUM 3 advisories 0.17.00.17.12
- MEDIUMRUSTSEC-2025-0010Versions of *ring* prior to 0.17 are unmaintained.
- MEDIUMGHSA-4p46-pwfr-66x6 CVE-2025-4432 GHSA-c86p-w88r-qvqr GO-2025-3678 RUSTSEC-2025-0009Some AES functions may panic when overflow checking is enabled in ring
- MEDIUMRUSTSEC-2025-0009 CVE-2025-4432 GHSA-4p46-pwfr-66x6 GHSA-c86p-w88r-qvqr GO-2025-3678Some AES functions may panic when overflow checking is enabled.
bytescrates.io 1.10.1 MEDIUM 2 advisories 1.11.1
- MEDIUMGHSA-434x-w66g-qw3r CVE-2026-25541 RUSTSEC-2026-0007bytes has integer overflow in BytesMut::reserve
- MEDIUMRUSTSEC-2026-0007 CVE-2026-25541 GHSA-434x-w66g-qw3rInteger overflow in `BytesMut::reserve`
randcrates.io 0.9.1 MEDIUM 2 advisories 0.8.60.9.30.10.1
- MEDIUMRUSTSEC-2026-0097 GHSA-cq8v-f236-94qcRand is unsound with a custom logger using `rand::rng()`
- LOWGHSA-cq8v-f236-94qc RUSTSEC-2026-0097Rand is unsound with a custom logger using rand::rng()
timecrates.io 0.3.41 MEDIUM 2 advisories 0.3.47
- MEDIUMGHSA-r6v5-fh4h-64xc CVE-2026-25727 RUSTSEC-2026-0009time vulnerable to stack exhaustion Denial of Service attack
- MEDIUMRUSTSEC-2026-0009 CVE-2026-25727 GHSA-r6v5-fh4h-64xcDenial of Service via Stack Exhaustion
tokio-postgrescrates.io 0.7.13 MEDIUM 2 advisories 0.7.18
- MEDIUMRUSTSEC-2026-0178 GHSA-3gjw-f78c-vvpwPanic on a `DataRow` with fewer fields than columns allows denial of service
- MEDIUMGHSA-3gjw-f78c-vvpw RUSTSEC-2026-0178tokio-postgres: Panic on a `DataRow` with fewer fields than columns allows denial of service
tracing-subscribercrates.io 0.3.19 MEDIUM 2 advisories 0.3.20
- MEDIUMRUSTSEC-2025-0055 CVE-2025-58160 GHSA-xwfj-jgwm-7wp5Logging user input may result in poisoning logs with ANSI escape sequences
- LOWGHSA-xwfj-jgwm-7wp5 CVE-2025-58160 RUSTSEC-2025-0055 Tracing logging user input may result in poisoning logs with ANSI escape sequences
anyhowcrates.io 1.0.98 MEDIUM 1 advisory 1.0.103
- MEDIUMRUSTSEC-2026-0190Unsoundness in `Error::downcast_mut()`
chronocrates.io 0.4.41 MEDIUM 1 advisory no fix yet
- MEDIUMRUSTSEC-2026-0543chrono is unmaintained
h2crates.io 0.3.26 MEDIUM 1 advisory 0.4.16
- MEDIUMRUSTSEC-2026-0258 GHSA-q83h-524g-xf6hh2 unbounded empty DATA frames
pastecrates.io 1.0.15 MEDIUM 1 advisory no fix yet
- MEDIUMRUSTSEC-2024-0436paste - no longer maintained
pin-utilscrates.io 0.1.0 MEDIUM 1 advisory no fix yet
- MEDIUMRUSTSEC-2026-0441`pin-utils` is unmaintained
rustls-pemfilecrates.io 1.0.4 MEDIUM 1 advisory no fix yet
- MEDIUMRUSTSEC-2025-0134rustls-pemfile is unmaintained
tokiocrates.io 1.44.2 MEDIUM 1 advisory 1.51.61.53.3
- MEDIUMRUSTSEC-2026-0386`AsyncFd::new` and related constructors violate I/O safety
urlcrates.io 2.5.4 MEDIUM 1 advisory 2.5.9
- MEDIUMRUSTSEC-2026-0592 GHSA-hrj5-67jp-wqp9Stack overflow in `Url::origin()` on nested `blob:` URLs
4 vulnerable packages outside the server itself (used only for development, tests or examples, not shipped)
aws-sdk-rdscrates.io 0.34.0 LOW 1 advisory 1.114.0
- LOWGHSA-g59m-gf8j-gjf5AWS SDK for Rust v1 adopted defense in depth enhancement for region parameter value
aws-sdk-s3crates.io 0.34.0 LOW 1 advisory 1.112.0
- LOWGHSA-g59m-gf8j-gjf5AWS SDK for Rust v1 adopted defense in depth enhancement for region parameter value
aws-sdk-ssocrates.io 0.30.0 LOW 1 advisory 1.89.0
- LOWGHSA-g59m-gf8j-gjf5AWS SDK for Rust v1 adopted defense in depth enhancement for region parameter value
aws-sdk-stscrates.io 0.30.0 LOW 1 advisory 1.91.0
- LOWGHSA-g59m-gf8j-gjf5AWS SDK for Rust v1 adopted defense in depth enhancement for region parameter value
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 |
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-02-03 |
| Signed releases | not checked yet |
Where it is published
| Listed in | 1 catalog (github_search) |
|---|---|
| License | MIT-0 |
| Created | 2025-05-03 |
| Topics | amazon-q-developer generative-ai 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.