Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
136 changes: 128 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,130 @@ to make this easy.

### Prerequisites

- [Deno](https://deno.land/) v2.x or later
Install one of these runtimes, depending on how you want to start the server:

### Setup with Claude Desktop
- [Node.js](https://nodejs.org/) v18.18 or later for `npx`
- [Bun](https://bun.sh/) v1.2 or later for `bunx` or direct Bun runs
- [Deno](https://deno.land/) v2.x or later for source-based Deno runs

### Run with npx or bunx

```bash
npx -y --package github:Tripletex/mcp-dependency-version mcp-dependency-version
```

```bash
bunx --bun github:Tripletex/mcp-dependency-version
```

These commands start an MCP stdio server, so direct terminal runs wait for MCP
JSON-RPC input and do not print a prompt.

### Setup with Claude Code CLI

Choose one of these commands.

Using npx:

```bash
claude mcp add mcp-dependency-version -- npx -y --package github:Tripletex/mcp-dependency-version mcp-dependency-version
```

Using Bun:

```bash
claude mcp add mcp-dependency-version -- bunx --bun github:Tripletex/mcp-dependency-version
```

Using Deno from a local checkout:

```bash
claude mcp add mcp-dependency-version -- deno run --allow-net --allow-env --allow-read /path/to/mcp-dependency-version/main.ts
```

### Setup with Codex CLI

Choose one of these commands.

Using npx:

```bash
codex mcp add mcp-dependency-version -- npx -y --package github:Tripletex/mcp-dependency-version mcp-dependency-version
```

Using Bun:

```bash
codex mcp add mcp-dependency-version -- bunx --bun github:Tripletex/mcp-dependency-version
```

Using Deno from a local checkout:

```bash
codex mcp add mcp-dependency-version -- deno run --allow-net --allow-env --allow-read /path/to/mcp-dependency-version/main.ts
```

### Setup with Codex config.toml

Codex stores MCP configuration in `~/.codex/config.toml`. You can also use a
project-scoped `.codex/config.toml` in trusted projects.

Using npx:

```toml
[mcp_servers."mcp-dependency-version"]
command = "npx"
args = ["-y", "--package", "github:Tripletex/mcp-dependency-version", "mcp-dependency-version"]
```

Using Bun:

```toml
[mcp_servers."mcp-dependency-version"]
command = "bunx"
args = ["--bun", "github:Tripletex/mcp-dependency-version"]
```

Using Deno from a local checkout:

```toml
[mcp_servers."mcp-dependency-version"]
command = "deno"
args = ["run", "--allow-net", "--allow-env", "--allow-read", "/path/to/mcp-dependency-version/main.ts"]
```

### Setup with Claude Desktop using npx

```json
{
"mcpServers": {
"mcp-dependency-version": {
"command": "npx",
"args": [
"-y",
"--package",
"github:Tripletex/mcp-dependency-version",
"mcp-dependency-version"
]
}
}
}
```

### Setup with Claude Desktop using bunx

```json
{
"mcpServers": {
"mcp-dependency-version": {
"command": "bunx",
"args": ["--bun", "github:Tripletex/mcp-dependency-version"]
}
}
}
```

### Setup with Claude Desktop using Deno

Add to your Claude Desktop configuration file
(`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS,
Expand All @@ -119,12 +240,6 @@ Add to your Claude Desktop configuration file
}
```

### Setup with Claude Code CLI

```bash
claude mcp add mcp-dependency-version -- deno run --allow-net --allow-env --allow-read /path/to/mcp-dependency-version/main.ts
```

### Setup with Docker

The service is available as a Docker image using stdio transport.
Expand Down Expand Up @@ -172,6 +287,11 @@ docker run --rm -i ghcr.io/tripletex/mcp-dependency-version:latest
deno task start
```

Or run it with Bun:
```bash
bun run main.ts
```

## Configuration

The server supports custom repository configurations for each registry type.
Expand Down
42 changes: 42 additions & 0 deletions bin/mcp-dependency-version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env node
import { spawn } from "node:child_process";
import { fileURLToPath, pathToFileURL } from "node:url";
import { dirname, resolve } from "node:path";
import process from "node:process";

const here = dirname(fileURLToPath(import.meta.url));
const entrypoint = resolve(here, "..", "main.ts");

if ("Bun" in globalThis) {
await import(pathToFileURL(entrypoint).href);
} else {
const npmExecPath = process.env.npm_execpath ?? "";
const npmUserAgent = process.env.npm_config_user_agent ?? "";
const launchedByBun = npmExecPath.includes("bun") ||
npmUserAgent.startsWith("bun/");

const command = launchedByBun ? "bun" : process.execPath;
const args = launchedByBun ? ["run", entrypoint, ...process.argv.slice(2)] : [
fileURLToPath(import.meta.resolve("tsx/cli")),
entrypoint,
...process.argv.slice(2),
];

const child = spawn(command, args, {
stdio: "inherit",
env: process.env,
});

child.on("error", (error) => {
console.error(`Failed to start ${command}: ${error.message}`);
process.exit(1);
});

child.on("exit", (code, signal) => {
if (signal) {
process.kill(process.pid, signal);
return;
}
process.exit(code ?? 1);
});
}
1 change: 1 addition & 0 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "mcp-dependency-version",
"version": "1.0.0",
"exports": "./main.ts",
"nodeModulesDir": "none",
"tasks": {
"start": "deno run --allow-net --allow-env --allow-read main.ts",
"dev": "deno run --allow-net --allow-env --allow-read --watch main.ts",
Expand Down
Loading