Skip to main content
Glama
pst291291

MCP Trust Layer

by pst291291
README.md
# MCP Trust Layer πŸ”’

**The first security scanner and trust verification layer for the MCP ecosystem.**

MCP (Model Context Protocol) is how AI agents connect to tools and data. With 21,000+ MCP servers on GitHub and enterprise deployments accelerating in 2026, there is **zero security verification in the ecosystem**.

MCP Trust Layer fixes that.

## Why This Exists

Every MCP server you install gets:
- Read access to `~/.ssh/id_rsa`, `~/.aws/credentials`
- Network access (exfiltrate data, SSRF)
- Process spawn access (run commands)
- Environment variable access (API keys)

**Not a single MCP marketplace audits for security.** One researcher found 3 of 8,764 servers leaked credentials under basic testing.

## Features

- **Scan any PyPI package** for secrets, dangerous patterns, and prompt injection vectors
- **Scan any GitHub repo** or source URL for security issues
- **Compare packages side-by-side** by security score
- **Trust Score (0-10)** β€” automated, reproducible security rating
- **Deep code analysis** across all Python files in a package

## Quick Start

### Install

```bash
pip install "mcp[cli]"
git clone https://github.com/YOUR_USERNAME/mcp-trust-layer.git
cd mcp-trust-layer
```

### Run (stdio)

```bash
python -m mcp run server.py --transport stdio
```

### Run (HTTP)

```bash
python server.py
# Server starts on http://127.0.0.1:8000
# Connect any MCP client to http://localhost:8000/mcp
```

### Add to Claude Code

```bash
claude mcp add --transport http mcp-trust http://localhost:8000/mcp
```

Then ask:
- "Scan the PyPI package 'flask' for security issues"
- "Compare the security scores of 'requests' and 'httpx'"
- "Scan github.com/owner/repo for vulnerabilities"

## Tools

| Tool | Description |
|------|-------------|
| `scan_pypi_package(name)` | Deep scan of a PyPI package. Downloads source, analyzes all Python files for secrets, dangerous patterns, and prompt injection vectors. Returns trust score + findings. |
| `scan_source_url(url)` | Scan code from a GitHub repo or direct archive URL. |
| `compare_packages(list)` | Compare multiple packages by security score side by side. |

## Resources

| URI | Description |
|-----|-------------|
| `trust://schema` | JSON schema for security reports |

## Architecture

```
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  MCP Client  │────▢│ Trust Scanner│────▢│  PyPI / GH  β”‚
β”‚ (Claude/Copilot)β”‚     β”‚  MCP Server  β”‚     β”‚  API        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚
                           β–Ό
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚  Trust Score  β”‚
                    β”‚  + Findings   β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
```

## Security Checks

The scanner detects:

- **Secrets**: API keys, tokens, passwords, private keys, connection strings
- **Dangerous patterns**: eval(), exec(), subprocess, file writes, network access
- **Supply chain risks**: dangerous imports, pickle deserialization, dynamic imports
- **Prompt injection vectors**: system prompt references, injection patterns

## Roadmap

- [x] PyPI package scanning
- [x] GitHub repo scanning
- [x] Security score (0-10)
- [ ] Live MCP server endpoint monitoring
- [ ] Continuous integration webhook alerts
- [ ] Enterprise compliance reports (SOC2, HIPAA)
- [ ] MCP marketplace integration API

## Marketplaces

This server is listed on:
- **mcp.so** β€” Largest MCP directory
- **Smithery** β€” CLI-first MCP installer
- **PulseMCP** β€” Community MCP index
- **Glama** β€” Quality-scored MCP directory

## License

MIT