Sponsored by Deepsite.site

AI Configuration Setup

Created By
kevinjalbert7 months ago
Centralized management of AI tool configurations (rules, commands, MCP servers) with streamlined setup for global and project-specific environments.
Content

AI Configuration Setup

The goal of this project is to:

  1. Simplify the management of AI configurations (rules, commands, and MCP servers) for AI tools
  2. Allow developers to maintain a single source of truth for their AI configuration
  3. Provide an easy setup process for both global and project-specific settings

How It Works

You have a single configuration directory that contains your rules, commands, and MCP server configuration. A single script will propagate your configuration to the correct locations for both AI tools.

⚠️ This has been built and tested on MacOS. Currently there is no support for Windows and Linux as these requires additional work.

Supported AI Tools 🛠️

AI ToolConfigurationsMCP ServersProject ScopeGlobal Scope
CopilotDetails🚧 (cursor's)
Claude CodeDetails
CursorDetails✅ (symlinks)

How to Use

  1. Setup the configuration directory and add your rules, commands, and MCP server configuration.
  2. Run scripts/setup --help to see all the options. You can control what configurations are setup.
  3. Run scripts/setup with appropriate flags to propagate your AI configurations to the correct locations.

If needed, you can reset your configuration by running scripts/reset. This will remove all the symlinks and removes globally configured files. This shouldn't be needed as the setup script is idempotent.

Configuration Directory Structure

Your configuration directory (~/ai_configs by default) should be structured to hold your rules, commands, and MCP server configuration. The directory can be overridden by setting the AI_CONFIGS_DIR environment variable when running the setup script.

~/ai_configs/
├── rules/                   # Directory containing rule files (.mdc)
│   ├── rule1.mdc
│   └── rule2.mdc
├── commands/                # Directory containing command files (.mdc)
│   ├── command1.mdc
│   └── command2.mdc
└── mcp-servers-config.json  # Configuration for MCP servers

It is important to note that the rules and commands are written as .mdc files. These files are used by the scripts/setup script to create the appropriate configuration files for the AI tools.

Example .mdc file

---
description: JavaScript coding standards for the project
globs: ["*.js", "*.jsx", "*.ts", "*.tsx"]
alwaysApply: false
---

You are a helpful AI assistant for JavaScript programming tasks. Always focus on readability and maintainability.

Even though some AI tools might not use .mdc files, we just keep the content (for context) and copy them as .md files.

Example mcp-servers-config.json

{
  "fetch": {
    "type": "stdio",
    "command": "uvx",
    "args": ["mcp-server-fetch"]
  }
}

AI Tool Specifics

Copilot Configuration

  • Global Rules: Rules are set in VSCode's settings (~/Library/Application Support/Code/User/settings.json) under the github.copilot.chat.codeGeneration.instructions key.

    • As the user's settings.json is JSON5, there isn't a reliable way to modify a value (for example using jq). So a marker system was used to be able to replace everything between the two marker keys:

      "__AI_TOOL_COPILOT_START": true,
      "github.copilot.chat.codeGeneration.instructions": [{"text":"rule1 content"},{"text":"rule2 content"},],
      "__AI_TOOL_COPILOT_END": true,
      
  • Global Commands: Commands (.mdc files) are copied to ~/Library/Application Support/Code/User/prompts with prompt.md extension

  • MCP Servers: Server configurations are not configured right now, but VSCode can leverage Cursor's MCP configuration

Claude Code Configuration

  • Global Rules: Rules (.mdc files) are concatenated into ~/.claude/CLAUDE.md
  • Global Commands: Commands (.mdc files) are copied to ~/.claude/commands/ with .md extension
  • MCP Servers: Server configurations (defined as mcp-servers-config.json) are added to ~/.claude.json

Cursor Configuration

  • Project-Based Rules: Rules directory is symlinked to .cursor/rules/local/rules in your project (based on pwd)
  • Project-Based Commands: Commands directory is symlinked to .cursor/rules/local/commands in your project (based on pwd)
  • MCP Servers: Server configurations (defined as mcp-servers-config.json) is copied to ~/.cursor/mcp.json

Limitations of Cursor

Cursor currently only supports project-based rules, not global rules. This means:

  • Rules and commands must be set up in each project directory where you want to use them.
  • This tool creates symlinks in the project directory to the central rules/commands.
  • Changes to your configuration files are automatically reflected in your projects due to the symlinks.

You might want to globally ignore the added local Cursor rules: **/.cursor/rules/local/** in your version control system.

Idempotent Updates

scripts/setup is designed to be idempotent, meaning you can run it multiple times without issues. This is useful when:

  • You've made changes to your rules or commands in your configuration directory
  • You want to apply your (project-based) configuration to a new project directory
  • You need to update MCP server configurations

For Cursor's project-based configurations, changes to your rule and command files are automatically reflected in your projects because they are symlinked. You don't need to rerun the setup script for these changes to take effect.

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
DeepChatYour AI Partner on Desktop
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Tavily Mcp
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
WindsurfThe new purpose-built IDE to harness magic
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Amap Maps高德地图官方 MCP Server
CursorThe AI Code Editor
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
ChatWiseThe second fastest AI chatbot™
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Playwright McpPlaywright MCP server
Serper MCP ServerA Serper MCP Server
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.