Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
Signed-off-by: Prabhu Subramanian <[email protected]>
  • Loading branch information
prabhu committed Feb 17, 2025
1 parent 88d8a3b commit 25dc8f1
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 11 deletions.
2 changes: 1 addition & 1 deletion contrib/mcp-server-vdb/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ LABEL maintainer="Team AppThreat" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.title="vulnerability-db" \
org.opencontainers.image.description="MCP server for AppThreat's vulnerability database and package search library." \
org.opencontainers.docker.cmd="docker run --rm -e VDB_HOME=/db -v /db:/db -v $(pwd):/app:rw -t ghcr.io/appthreat/mcp-server-vdb"
org.opencontainers.docker.cmd="docker run -i --rm -e VDB_HOME=/db -v $HOME/db:/db:rw ghcr.io/appthreat/mcp-server-vdb:master"

WORKDIR /app

Expand Down
43 changes: 37 additions & 6 deletions contrib/mcp-server-vdb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,42 @@ This folder contains the source code for running VDB as a Model Context Protocol
## Pre-requisites

- Python >= 3.10 installed
- docker or Rancher Desktop (or)
- uv [installed](https://docs.astral.sh/uv/getting-started/installation/)

## Local uv-based execution
## docker-based execution (Recommended)

Use our container image `ghcr.io/appthreat/mcp-server-vdb:master`.

### Claude Desktop configuration

Edit the file using VS code or any editor of your choice. `~/Library/Application Support/Claude/claude_desktop_config.json`. On Windows, the config file is `$env:AppData\Claude\claude_desktop_config.json`. Use the below configuration:

```json
{
"mcpServers": {
"vdb": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"VDB_HOME=/db",
"-v",
"$HOME/vdb:/db:rw",
"ghcr.io/appthreat/mcp-server-vdb:master"
]
}
}
}
```

Restart the Claude Desktop application.

If you get `ENOENT` error, specify the full path to docker. On a mac, `/Applications/Docker.app/Contents/Resources/bin/docker`.

## Local uv-based execution (Developers only)

```shell
git clone https://github.com/AppThreat/vulnerability-db.git
Expand All @@ -20,11 +53,7 @@ vdb --download-image
uv --directory contrib/mcp-server-vdb run mcp-server-vdb
```

## docker-based execution

Our container image `ghcr.io/appthreat/mcp-server-vdb:master` is currently not working in stdio mode. There appears to be a limitation with Claude Desktop not supporting docker in interactive mode. Please send a pull request if you have any workarounds.

## Claude Desktop configuration
### Claude Desktop configuration

Edit the file using VS code or any editor of your choice. `~/Library/Application Support/Claude/claude_desktop_config.json`. On Windows, the config file is `$env:AppData\Claude\claude_desktop_config.json`.

Expand Down Expand Up @@ -54,6 +83,8 @@ Use the below configuration and adjust the following paths:

Restart the Claude Desktop application.

## Screenshots

### Claude context screen

![Claude context](../claude-context.png)
Expand Down
2 changes: 1 addition & 1 deletion contrib/mcp-server-vdb/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "mcp-server-vdb"
version = "0.1.0"
version = "1.0.0"
description = "AppThreat Vulnerability Database MCP server"
authors = [
{name = "Team AppThreat", email = "[email protected]"},
Expand Down
5 changes: 3 additions & 2 deletions contrib/mcp-server-vdb/src/mcp_server_vdb/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,9 @@ def print_results(results):


async def run():
server = Server("appthreat-vulnerability-db")

@asynccontextmanager
async def server_lifespan() -> AsyncIterator[dict]:
async def lifespan() -> AsyncIterator[dict]:
"""Manage server startup and shutdown lifecycle."""
global db_conn, index_conn
try:
Expand All @@ -96,6 +95,8 @@ async def server_lifespan() -> AsyncIterator[dict]:
if index_conn:
index_conn.close()

server = Server("appthreat-vulnerability-db", version="1.0.0")

@server.list_resources()
async def handle_list_resources() -> list[mtypes.Resource]:
return [
Expand Down
2 changes: 1 addition & 1 deletion contrib/mcp-server-vdb/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 25dc8f1

Please sign in to comment.