Skip to main content
Glama

Context Injection MCP Server

A Model Context Protocol (MCP) server that automatically injects development framework context into Claude conversations.

Overview

This MCP server integrates with Claude Desktop to automatically inject your development framework context into conversations when you start discussing new projects or development tasks. It ensures Claude follows your established patterns and workflows without having to manually provide this context each time.

The server also supports referencing your Knowledge Graph to ensure Claude leverages your stored development frameworks, patterns, and workflows when responding.

Features

  • Automatic Context Injection: Detects development-related conversations and automatically injects your framework context.

  • Keyword Detection: Customize keywords that trigger context injection.

  • Solo Developer Framework: Includes a predefined Solo Developer Framework with workflows and best practices.

  • Knowledge Graph References: Add references to your Knowledge Graph to leverage your stored development knowledge.

  • CLI Tools: Simple command-line interface for setup and operation.

Framework Included

The default context includes:

  1. Solo Developer Workflow: A 9-step process for efficient solo development

  2. AI Collaboration Framework: A structured approach for working with AI assistants

  3. Short Prompt Development: Pattern for generating implementations from brief instructions

Installation

  1. Clone the repository

  2. Install dependencies:

npm install
  1. Build the project:

npm run build

Usage

Setup

Initialize the project with default configuration and context files:

npm run setup

This creates:

  • config.json: Server configuration

  • context.json: Development context for injection

Starting the Server

npm run start

Or with a custom config file:

npm run start -- -c path/to/config.json

Creating a Custom Context

npm run create-context -- -o path/to/output.json

Configuring Knowledge Graph References

View current configuration:

npm run -- config --show

Enable Knowledge Graph references:

npm run -- config --kg-reference

Disable Knowledge Graph references:

npm run -- config --no-kg-reference

Customize Knowledge Graph reference text:

npm run -- config --kg-text "Please reference my Knowledge Graph for our team's development patterns."

Integration with Claude Desktop

To use this MCP server with Claude Desktop:

  1. Open your Claude Desktop configuration

  2. Add the following to your MCP servers configuration:

"context-injection": { "command": "node", "args": [ "/path/to/mcp-instruction-injection/dist/index.js", "start" ] }

Claude Desktop Integration

Overview

This MCP Context Injection service can be integrated with Claude Desktop to automatically inject contextual information into your conversations with Claude. Integration uses the Model Context Protocol (MCP) which allows Claude to communicate with external tools.

Setup Instructions

  1. First, make sure you have the latest version of Claude Desktop installed

  2. Configure Claude Desktop to use this MCP server:

    Windows:

    • Open your Claude Desktop configuration file at:

      %APPDATA%\Claude\claude_desktop_config.json
    • If the file doesn't exist, create it

    • Add the following configuration (adjust paths to match your installation):

      { "mcpServers": { "context-injection": { "command": "node", "args": [ "C:\\apps\\mcp-instruction-injection\\dist\\cli.js", "mcp-start", "--config", "C:\\apps\\mcp-instruction-injection\\config.json" ] } } }

    MacOS:

    • Open your Claude Desktop configuration file at:

      ~/Library/Application Support/Claude/claude_desktop_config.json
    • If the file doesn't exist, create it

    • Add the following configuration (adjust paths to match your installation):

      { "mcpServers": { "context-injection": { "command": "node", "args": [ "/path/to/mcp-instruction-injection/dist/cli.js", "mcp-start", "--config", "/path/to/mcp-instruction-injection/config.json" ] } } }
  3. Save the configuration file and restart Claude Desktop

  4. Verify the integration is working:

    • Open Claude Desktop

    • Look for the hammer icon in the interface that indicates available tools

    • The context injection tool should appear in the list

Troubleshooting

If you're having issues with the integration:

  1. Tool not appearing in Claude Desktop:

    • Ensure the configuration file is properly set up with the correct paths

    • Restart Claude Desktop completely

    • Check the context injection server logs for any errors

  2. JSON parsing errors:

    • Make sure you're using the mcp-start command, not the regular start command

    • The MCP protocol requires proper JSON-RPC messaging through stdin/stdout

  3. Port conflicts:

    • The MCP adapter doesn't use HTTP ports as it communicates through stdin/stdout

    • If you see port conflict errors, it means you're using the wrong mode

  4. Request timeouts:

    • Check your internet connection

    • Ensure the context service can access any external resources it needs

For detailed debugging, run Claude Desktop from the command line to see error messages.

Knowledge Graph Usage

This server adds a reference to your Knowledge Graph in the injected context, prompting Claude to access your stored development frameworks, patterns, and workflows stored there. The Knowledge Graph itself should be managed separately.

You can customize the reference text using the --kg-text config parameter.

Configuration

The config.json file allows you to customize:

  • port: The port the server runs on (default: 3000)

  • contextPath: Path to the context file

  • autoInject: Whether to automatically inject on all messages

  • triggerKeywords: Words that trigger injection when autoInject is false

  • knowledgeGraphReference: Whether to include Knowledge Graph reference

  • knowledgeGraphReferenceText: Text to include when referencing Knowledge Graph

Project Structure

src/ ├── types/ # Type definitions ├── services/ # Core services ├── templates/ # Context templates ├── utils/ # Utility functions ├── cli.ts # CLI implementation ├── index.ts # Main entry point └── server.ts # MCP server implementation

License

MIT

-
security - not tested
F
license - not found
-
quality - not tested

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sabatajoxicraft/mcp-instruction-injection'

If you have feedback or need assistance with the MCP directory API, please join our Discord server