Skip to content

hittoSepi/mcp-inline-complete

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MCP Inline Complete

AI-powered inline code completions for VS Code via a Model Context Protocol server.

Architecture

VS Code Extension (MCP Client)
  └── InlineCompletionItemProvider
        │  debounce + context extraction
        │
        └──── stdio ────► MCP Server
                            └── get_inline_completion tool
                                  └── Anthropic Claude API

Setup

Prerequisites

  • Node.js ≥ 18
  • ANTHROPIC_API_KEY environment variable set

Install & Build

# Install all dependencies
npm install

# Build everything
npm run build

Development

# Terminal 1: Watch server
cd packages/server && npm run dev

# Terminal 2: Watch extension
cd packages/extension && npm run dev

Run in VS Code

  1. Open this repo in VS Code
  2. Press F5 → launches Extension Development Host
  3. The MCP server starts automatically as a child process
  4. Type code → ghost text completions appear after the debounce delay

Configuration

Setting Default Description
mcpInlineComplete.enabled true Enable/disable completions
mcpInlineComplete.debounceMs 300 Delay before requesting completion (ms)
mcpInlineComplete.prefixLines 100 Lines before cursor sent as context
mcpInlineComplete.suffixLines 30 Lines after cursor sent as context

Toggle

  • Command palette: MCP Inline Complete: Toggle On/Off
  • Status bar: click the ✦ MCP indicator

Project Structure

packages/
  shared/     ← Shared TypeScript types
  server/     ← MCP server (stdio transport, Anthropic SDK)
  extension/  ← VS Code extension (InlineCompletionItemProvider)

Customization

Swap the LLM

Edit packages/server/src/index.ts — replace the Anthropic call with any other provider (OpenAI, Ollama, local model, etc). The MCP interface stays the same.

Add more tools

The MCP server can expose additional tools alongside get_inline_completion:

  • get_hover_info — context-aware hover documentation
  • refactor_selection — AI-powered refactoring suggestions
  • explain_code — inline code explanations

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors