Skip to content
Closed
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
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ env/

# IDE
.vscode/
!.vscode/
.vscode/*
!.vscode/mcp.json
.idea/
*.swp
*.swo
Expand Down Expand Up @@ -84,4 +87,4 @@ site/
*.log
*.tmp
temp/
tmp/
tmp/
12 changes: 12 additions & 0 deletions .vscode/mcp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"mcpServers": {
"shortkit-ml": {
"type": "stdio",
"command": ".venv/bin/python",
"args": [
"-m",
"shortcut_detect.mcp_server"
]
}
}
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,13 @@ Custom conditions can be registered via `@register_condition("name")`. See [Cond

## MCP Server

ShortKit-ML ships an [MCP](https://modelcontextprotocol.io/) server so AI assistants (Claude, Cursor, etc.) can call detection tools directly from chat — no Python script required.
ShortKit-ML ships an [MCP](https://modelcontextprotocol.io/) server so AI assistants (Claude, Cursor, GitHub Copilot in VS Code, etc.) can call detection tools directly from chat — no Python script required.

```bash
uv pip install -e ".[mcp]"
```

Full setup instructions for **Claude Code** and **Claude Desktop**, available tools, file-based input, and troubleshooting: [**criticaldata.github.io/ShortKit-ML/mcp-server**](https://criticaldata.github.io/ShortKit-ML/mcp-server/).
Full setup instructions for **Claude Code**, **Claude Desktop**, and **GitHub Copilot in VS Code**, available tools, file-based input, and troubleshooting: [**criticaldata.github.io/ShortKit-ML/mcp-server**](https://criticaldata.github.io/ShortKit-ML/mcp-server/).

## Paper Benchmark Datasets

Expand Down
34 changes: 31 additions & 3 deletions docs/mcp-server.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MCP Server

ShortKit-ML ships a [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server that exposes shortcut detection as callable tools. AI assistants like Claude can run full analyses — generate data, run detectors, compare methods — directly from chat, with no Python script required.
ShortKit-ML ships a [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server that exposes shortcut detection as callable tools. AI assistants like Claude and GitHub Copilot in VS Code can run full analyses — generate data, run detectors, compare methods — directly from chat, with no Python script required.

## Prerequisites

Expand All @@ -18,8 +18,6 @@ uv run python -m shortcut_detect.mcp_server

The server should start without errors. Press `Ctrl+C` to stop it.

---

## Option 1 — Claude Code (recommended)

Claude Code reads a `.mcp.json` file from the project root. This file is already committed to the repo, so no manual setup is needed after installing the package.
Expand Down Expand Up @@ -113,6 +111,36 @@ Once connected, you can run all 19 detection methods on synthetic data directly

---

## Option 3 — GitHub Copilot in VS Code

GitHub Copilot Chat in VS Code can consume MCP servers directly in Agent mode. This repository includes a checked-in `.vscode/mcp.json` template so the ShortKit-ML server is ready to use once your `.venv` is installed.

### 1. Install dependencies

```bash
uv pip install -e ".[mcp]"
```

### 2. Open the workspace in VS Code

Make sure the repo root is open so VS Code can read `.vscode/mcp.json`.

### 3. Start Copilot Chat in Agent mode

Open Copilot Chat, switch the mode dropdown to **Agent**, and click the tools icon. Under the `shortkit-ml` MCP server, you should see the ShortKit-ML tools.

### 4. Try a prompt

```text
Generate 200 synthetic samples with a linear shortcut and run probe, statistical, and hbac on them.
```

### 5. If you need to customize the Python path

Edit `.vscode/mcp.json` and point `command` at your workspace `.venv/bin/python` path. Use the same `shortcut_detect.mcp_server` module entry point as Claude Code and Claude Desktop.

---

## Quick start — how to use the tools

Once connected, the tools are **automatic** — Claude calls them for you based on what you ask. You never invoke them by name. Just describe what you want in plain English.
Expand Down
21 changes: 21 additions & 0 deletions tests/test_copilot_mcp_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
"""Tests for the checked-in Copilot / MCP workspace configuration."""

import json
from pathlib import Path


def test_vscode_mcp_config_matches_project_entrypoint():
root = Path(__file__).resolve().parents[1]
claude_config = json.loads((root / ".mcp.json").read_text(encoding="utf-8"))
vscode_config = json.loads((root / ".vscode" / "mcp.json").read_text(encoding="utf-8"))

claude_server = claude_config["mcpServers"]["shortkit-ml"]
vscode_server = vscode_config["mcpServers"]["shortkit-ml"]

assert claude_server["type"] == "stdio"
assert vscode_server["type"] == "stdio"
assert claude_server["command"] == vscode_server["command"] == ".venv/bin/python"
assert claude_server["args"] == vscode_server["args"] == [
"-m",
"shortcut_detect.mcp_server",
]
Loading