Skip to main content
Glama
README.md
# MCP - Agent to VSC

Local MCP server that connects an MCP-capable VS Code agent such as Cline to OpenAI and workspace file tools.

## Flow

`Cline / VS Code -> MCP (stdio) -> local Node.js server -> OpenAI API`

## Tools

- `ask_ai` — send prompts to OpenAI
- `read_file` — read workspace files
- `write_file` — write workspace files
- `list_files` — list workspace files/directories
- `workspace_info` — inspect configuration

## Install

Requirements: Node.js 20+.

```bash
npm install
```

Set `OPENAI_API_KEY` in the environment. Never commit the real key.

PowerShell:

```powershell
$env:OPENAI_API_KEY="sk-..."
npm start
```

## Cline

Add this server to Cline's MCP settings:

```json
{
  "mcpServers": {
    "mcp-agent-to-vsc": {
      "command": "node",
      "args": ["C:\\path\\to\\mcp-agent-to-vsc\\server.mjs"],
      "env": {
        "OPENAI_API_KEY": "YOUR_API_KEY",
        "OPENAI_MODEL": "gpt-5.6",
        "WORKSPACE_ROOT": "C:\\path\\to\\your\\workspace"
      }
    }
  }
}
```

For local VS Code MCP configuration, see `.vscode/mcp.json`.

## Security

The server restricts file access to `WORKSPACE_ROOT`. Keep your API key in an environment variable or an ignored `.env` file.

TDQS

B3.4/5.0

Scored across 5 tools

Disambiguation5/5

Each tool targets a distinct function: AI query, file read, file write, file listing, and workspace configuration. There is no functional overlap, so an agent can reliably select the correct tool.

Naming Consistency4/5

Most names follow a verb_noun pattern (ask_ai, read_file, write_file, list_files), but workspace_info breaks the pattern as a noun phrase. Overall the naming is clear and predictable.

Tool Count5/5

Five tools is a well-scoped set for an agent-to-VS Code integration covering the essential file operations, AI interaction, and workspace context. Each tool earns its place without redundancy.

Completeness4/5

The set covers core file read/write/list and AI query, which covers common agent workflows. Minor gaps include delete or rename file operations, but these are not critical for the apparent purpose.

Maintenance

ActivityMaintained
ResponsivenessSyncing