mcp-servers ai-coding-assistant cursor claude-code github-copilot openai-codex prompt-files developer-tools tools skills token-efficiency productivity

Using MCP Servers, Tools, Skills, and Prompt Files with AI Coding Assistants

Kelifax Team
15 min read

AI coding assistants have moved far beyond simple autocomplete. Platforms like Cursor, Claude Code, GitHub Copilot, and OpenAI Codex now support MCP servers, tool integrations, skills, and prompt files — features that fundamentally change how much value you extract from these tools. Most developers are using only a fraction of what these platforms can do. This guide covers exactly how to configure each layer so your AI assistant has the right context, accesses the right systems, and operates as efficiently as possible — using fewer tokens to deliver better results.

What You'll Learn

  • What MCP servers, tools, skills, and prompt files are — and how they relate to each other
  • How to connect MCP servers to Cursor, Claude Code, GitHub Copilot, and OpenAI Codex
  • How to write effective prompt files (CLAUDE.md, .cursorrules, copilot-instructions.md) that reduce repeated context
  • Strategies for cutting token usage without sacrificing output quality
  • Practical setups for individual developers and teams

Understanding the Building Blocks

Before diving into platform-specific setups, it helps to understand what each layer does and how the pieces fit together.

MCP Servers

Model Context Protocol (MCP) servers are standardized services that expose tools, data sources, and resources to any compatible AI client. Instead of building custom integrations into every AI tool, you run one MCP server that multiple clients can connect to. An MCP server might expose your database schema, your file system, a set of shell commands, or your internal API — all in a way the AI can use directly during a conversation.

Tools

Tools are callable functions that an AI assistant can invoke to take action. When you ask Cursor to run your test suite, it uses a tool. When Claude Code reads a file outside the current context window, it uses a tool. Tools are the "hands" of the AI — they enable it to go beyond text generation and actually interact with your environment.

Skills

Skills are packaged, reusable capabilities layered on top of tools. GitHub Copilot uses this concept through Copilot Extensions, which bundle specific toolsets (like a Sentry integration or a Datadog skill) that the AI can call on demand. Think of skills as curated tool collections with built-in reasoning about when and how to use them.

Prompt Files

Prompt files are persistent instruction documents stored in your repository or configuration directory. They provide standing context to the AI — your tech stack, coding conventions, architectural decisions, and project-specific rules — without you repeating this information in every conversation. They are the most underused efficiency tool available to developers today.

MCP Servers on AI Coding Assistants

Why MCP Servers Change the Game

Without MCP, you would manually paste database schemas, API docs, or terminal output into your chat window. This wastes tokens, breaks your flow, and forces the AI to reason about out-of-date or incomplete information. With an MCP server, the AI can query that data directly, on demand, and only when it needs it. This keeps your context window clean and reduces the number of tokens consumed per task.

Cursor and MCP Servers

Cursor has native MCP support built into its agent mode. You configure MCP servers in your .cursor/mcp.json file, and Cursor exposes them as available tools whenever you work in agent mode.

A basic .cursor/mcp.json configuration looks like this:

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/project"]
    },
    "postgres": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-postgres"],
      "env": {
        "DATABASE_URL": "postgresql://user:pass@localhost:5432/mydb"
      }
    }
  }
}

With the filesystem and Postgres MCP servers connected, Cursor can read source files outside the active editor tab, query your database schema, and run exploratory queries — all without you pasting anything into the chat.

Highly useful MCP servers for Cursor:

  • Filesystem MCP: Access files anywhere in your project, not just open tabs
  • Git MCP: Query commit history, diffs, and branch state directly
  • PostgreSQL / SQLite MCP: Schema introspection and query execution
  • Fetch MCP: Pull live documentation or API specs from URLs
  • Browser tools MCP: Interact with a browser for end-to-end debugging
  • GitHub MCP: Query issues, PRs, and repo data from within your editor

Claude Code and MCP Servers

Claude Code, Anthropic's terminal-based coding agent, treats MCP as a first-class feature. You can configure project-level MCP servers in a .mcp.json file at the root of your repository, or globally via ~/.claude/mcp.json.

Claude Code's agentic model means it actively decides when to use each MCP tool. When you ask it to implement a feature, it might use the filesystem MCP to read related files, the GitHub MCP to check related issues, and a custom internal API MCP to understand your data contracts — all in a single task loop.

Claude Code MCP advantages:

  • Project-scoped MCP servers committed to the repo for team consistency
  • The agent autonomously decides which tools to call and in what order
  • MCP resources (not just tools) can provide read-only context like documentation
  • Supports permission levels to restrict what the agent can modify

OpenAI Codex CLI and Tools

OpenAI Codex in its CLI form supports shell execution as a core capability. You can extend it by providing tool definitions that map to scripts or local services. While the MCP protocol is not natively built in at the same level as Cursor or Claude Code, Codex's sandboxed execution model allows it to run code, read files, and call APIs as part of its reasoning loop.

For teams using Codex, the recommended pattern is to wrap your internal tools as shell scripts and let Codex invoke them. Pair this with a detailed system prompt (configured in your Codex profile) to define what tools are available and when to use them.

GitHub Copilot and MCP

GitHub Copilot in agent mode (available in VS Code) supports MCP server connections through its settings. You configure them in VS Code's settings.json under the github.copilot.chat.mcp.servers key. Once connected, Copilot's agent can call MCP tools during multi-step tasks, similar to Cursor's implementation.

Tools Built Into AI Coding Assistants

Each platform ships with a set of built-in tools that are available without any configuration. Understanding what is already there prevents you from duplicating work.

Cursor Built-in Tools

  • Codebase search: Semantic search across your entire project
  • File read/write: Create, edit, and delete files
  • Terminal execution: Run shell commands in the integrated terminal
  • Web search: Pull in documentation and Stack Overflow answers
  • Diff application: Apply multi-file changes with precision

Claude Code Built-in Tools

  • Read/write files: Full filesystem access within your project
  • Bash execution: Run any shell command, including build scripts and tests
  • Web fetch: Retrieve documentation from URLs
  • Task management: Internal planning and sub-task delegation for complex work

GitHub Copilot Skills and Extensions

GitHub Copilot supports Extensions — third-party integrations that appear as @skillname mentions in chat. These are published through the GitHub Marketplace and cover platforms like Sentry, DataStax, Mermaid diagramming, and more. When you type @sentry in a Copilot chat, the Sentry skill can query your error logs and surface relevant issues directly in the conversation.

Skills are particularly powerful for team workflows because they standardize how AI accesses external services. Instead of each developer knowing their own Sentry API queries, everyone uses the same skill and gets consistent results.

Prompt Files: Persistent Context Without Wasting Tokens

This is where most developers leave significant value on the table. Prompt files let you encode your project knowledge once and have it automatically applied to every conversation. They eliminate the need to re-explain your tech stack, naming conventions, or architectural constraints on every session.

CLAUDE.md for Claude Code

Claude Code reads a CLAUDE.md file from the root of your repository and uses it as standing context. This is the most powerful prompt file in any AI coding tool because Claude Code is an agentic system — it will read and re-reference CLAUDE.md throughout a task, not just at the start.

What to put in CLAUDE.md:

  • Project overview: what the system does and who uses it
  • Tech stack: languages, frameworks, major dependencies with versions
  • Architecture decisions and their reasons (avoids Claude suggesting approaches you've already ruled out)
  • File structure conventions: where to put new files, naming patterns
  • Testing requirements: what kind of tests are expected and how to run them
  • Environment setup: how to start the dev server, what env variables are needed
  • Code style rules: TypeScript strictness settings, linting rules, formatting preferences
  • Do-not-touch areas: files or patterns the agent should not modify

A well-written CLAUDE.md can cut the average task token cost by 30 to 50 percent because the AI stops asking clarifying questions about known context.

.cursorrules and .cursor/rules/ for Cursor

Cursor supports a legacy .cursorrules file at the project root and a newer .cursor/rules/ directory for scoped rules. The directory approach lets you create different rule sets for different parts of your project.

Example .cursor/rules/ structure:

.cursor/
  rules/
    backend.md      # Rules for /src/api/ and /src/lambda/
    frontend.md     # Rules for /src/components/ and /src/pages/
    testing.md      # Rules for all test files
    global.md       # Rules applied everywhere

Each rule file supports frontmatter to define when it applies:

---
description: "Backend Lambda rules"
globs: ["src/lambda/**", "infra/src/**"]
alwaysApply: false
---

Always use Python type hints. Never use mutable default arguments. Error handling must use the project’s custom AppError class. All Lambda handlers must follow the handler(event, context) signature.

Note: Scoped rules with specific globs are more effective than one large global file. Cursor loads only the relevant rules for the files being edited, keeping context focused and token usage low.

.github/copilot-instructions.md for GitHub Copilot

GitHub Copilot reads a .github/copilot-instructions.md file from your GitHub repository and applies it as custom instructions for every Copilot conversation on that repo. This file is particularly valuable for teams because it is version-controlled and applied consistently across all contributors.

What works well in copilot-instructions.md:

  • Language and framework preferences ("This is a TypeScript project. Always use strict mode.")
  • Testing patterns ("Use Vitest, not Jest. Tests go in __tests__/ directories.")
  • API conventions ("All API responses use the ApiResponse wrapper type defined in src/types/api.ts.")
  • Dependency restrictions ("Do not add new npm dependencies without a comment explaining why.")
  • Repository structure overview

In addition to the repository-level file, Copilot supports personal custom instructions in VS Code settings under github.copilot.chat.codeGeneration.instructions. Use repository instructions for project-specific rules and personal instructions for universal preferences like your preferred code style.

OpenAI Codex System Prompts

OpenAI Codex in the CLI accepts a system prompt via configuration. This is the equivalent of the above prompt files — use it to describe your environment, preferred shell commands, coding conventions, and the tools Codex is allowed to use. Because Codex runs in a sandbox, a thorough system prompt is especially important for directing what it should and should not execute.

Context Management and Token Efficiency

Each conversation with an AI coding assistant consumes tokens for both input and output. Poor context management is the fastest way to burn through rate limits, slow down responses, and get lower-quality results as the context window fills with irrelevant information.

Why Token Efficiency Matters

  • Cost: On paid plans with usage-based billing, excess tokens mean higher costs
  • Speed: Larger context windows take longer to process
  • Quality: Relevant, focused context produces better outputs than padded, noisy context
  • Rate limits: Staying within per-minute and per-day token limits keeps your workflow uninterrupted

Strategies to Reduce Token Usage

1. Use prompt files instead of repeated instructions

If you find yourself explaining your project structure in every new chat, that explanation belongs in a prompt file. Prompt files are loaded once and reused — you write the context once and benefit from it indefinitely.

2. Scope your MCP tools

Do not connect every MCP server you have to every session. Connect only the servers relevant to the current task. A database MCP server loaded during a pure frontend styling task adds tokens without value.

3. Reference files instead of pasting them

In tools like Cursor and Claude Code, reference a file by path rather than pasting its contents manually. The AI's built-in file reading tools fetch only what they need when they need it, which is more token-efficient than pre-loading entire files.

4. Use short, targeted prompts

With a well-written CLAUDE.md or .cursorrules in place, your prompts can be concise. Instead of "In this TypeScript project that uses Prisma for database access and follows our custom error handling patterns, please add a user profile endpoint", you can write "Add a user profile endpoint" because the standing context already covers the rest.

5. Break large tasks into focused sub-tasks

Long agentic tasks accumulate context. Splitting a large feature into discrete, focused sessions keeps each context window clean and allows the AI to start fresh with full capacity for each sub-task.

6. Use .gitignore patterns in MCP filesystem access

Configure your filesystem MCP server to respect .gitignore. There is no reason for the AI to index node_modules, build outputs, or generated files — these only pollute search results and consume tokens.

Platform Setup Guides

Setting Up Cursor for Maximum Efficiency

  1. Create .cursor/mcp.json with the MCP servers relevant to your stack (filesystem, git, and a database server cover most projects)
  2. Create .cursor/rules/ directory with scoped rule files for different parts of the codebase
  3. Enable agent mode in Cursor settings and verify MCP servers appear under the available tools list
  4. Test with a task that requires multi-file context to confirm MCP tools are being invoked
  5. Review Cursor's token usage in the status bar and adjust rule scope if the context is larger than expected

Setting Up Claude Code

  1. Install Claude Code via npm install -g @anthropic-ai/claude-code
  2. Create CLAUDE.md at the project root with your project overview, tech stack, and conventions
  3. Create .mcp.json for project-scoped MCP servers and commit it to the repository
  4. Run claude in your project directory and verify it reads CLAUDE.md on startup
  5. Use /mcp in the Claude Code chat to inspect connected servers and confirm tools are available
  6. Test an agentic task ("implement the feature described in issue #42") to see it combine file reading, MCP tools, and bash execution automatically

Setting Up GitHub Copilot with Custom Instructions

  1. Create .github/copilot-instructions.md in your repository and commit it
  2. Open VS Code and open Copilot Chat — your instructions apply immediately
  3. Add Copilot Extensions relevant to your stack from the GitHub Marketplace
  4. For MCP support: add server configs to VS Code settings under github.copilot.chat.mcp.servers
  5. Switch to agent mode in Copilot Chat and give it a multi-step task to confirm MCP tools are available

Setting Up OpenAI Codex CLI

  1. Install Codex CLI and authenticate with your OpenAI API key
  2. Create a Codex profile configuration file with a thorough system prompt covering your project context and allowed operations
  3. Wrap frequently used internal scripts as shell commands Codex can invoke
  4. Use the --approval-mode suggest flag while building confidence in Codex's actions, then move to auto-edit once you trust the setup
  5. Monitor API usage in your OpenAI dashboard and refine your system prompt to reduce unnecessary context

Best Practices Across All Platforms

Version control your configuration

Commit CLAUDE.md, .cursorrules, .cursor/rules/, .mcp.json, and .github/copilot-instructions.md to your repository. This makes AI assistant configuration a team-level concern, not an individual developer's setup step. New team members inherit the full AI configuration the moment they clone the repo.

Iterate on prompt files regularly

Your prompt files should evolve as your project does. When you make a significant architectural decision, update CLAUDE.md. When your team adopts a new testing pattern, update copilot-instructions.md. Treat prompt files as living documentation that happens to also instruct your AI assistant.

Use read-only MCP servers by default

When configuring MCP servers, start with read-only access and add write permissions only when you have a specific need. A Postgres MCP server that can only run SELECT queries is far safer than one with full write access — especially when used with an agentic AI that can execute multiple tool calls autonomously.

Test with a known task

After any configuration change, test with a task you know well. If the AI's output degrades after adding a new MCP server or changing a prompt file, you can diagnose the issue immediately rather than discovering it during real work.

Match the tool to the task type

  • Inline completion tasks (finishing a function, suggesting a variable name): GitHub Copilot in the editor. No MCP overhead needed.
  • Conversational code tasks (explain this, refactor this section): Cursor chat or Copilot chat. Scoped rules apply.
  • Multi-file agentic tasks (implement this feature end to end): Claude Code or Cursor agent mode with relevant MCP servers connected.
  • Automated scripting tasks (run this pipeline, apply these changes across the codebase): OpenAI Codex CLI in the terminal with a configured system prompt.

The Efficiency Compounding Effect

None of these optimizations are dramatic in isolation. A well-written CLAUDE.md saves a few hundred tokens per session. An appropriate MCP scope saves a few tool calls per task. A scoped .cursor/rules/ setup reduces irrelevant context per file edit. But when all of these layers are configured together, the compounding effect is significant: faster responses, more accurate outputs, lower token costs, and an AI assistant that feels like it actually knows your project rather than meeting it for the first time each session.

The developers who get the most out of Cursor, Claude, GitHub Copilot, and OpenAI Codex are not just using them as smart autocomplete — they treat the configuration layer as a first-class part of their development environment. Invest an hour setting up your prompt files and MCP servers, and that investment pays back every single day.

Related Resources

The platforms covered in this guide are all available in the Kelifax resource catalog:

AI Coding Assistants

  • Cursor - AI-native code editor with first-class MCP support and scoped rules
  • GitHub Copilot - In-editor AI assistant with Extensions, Skills, and MCP integration in agent mode
  • Claude by Anthropic - The model powering Claude Code, with strong long-context and agentic reasoning
  • OpenAI Codex - Terminal-based coding agent designed for automated code tasks and scripting workflows

Developer Tools

  • Visual Studio Code - The foundation editor for GitHub Copilot, with MCP support via settings
  • GitHub - Hosts copilot-instructions.md, Copilot Extensions Marketplace, and repository context used by all AI assistants

Related Resources from Kelifax

Share this insight

Help other developers discover this content