Customization — Instructions, Prompt Files & MCP
Teach Copilot your project's conventions using custom instructions, create reusable prompt files, connect MCP servers, and explore Copilot Spaces.
Teach Copilot your project's conventions using custom instructions, create reusable prompt files, connect MCP servers, and explore Copilot Spaces.
Custom instructions let you give Copilot persistent context about your project — coding style, tech stack, naming conventions — so you don't have to repeat it in every chat message.
Create .github/copilot-instructions.md at the root of your repository:
# Project: Acme Commerce Platform
## Tech Stack
- Next.js 15 (App Router), TypeScript strict
- Tailwind CSS v4 — no tailwind.config.js
- Drizzle ORM + Postgres
- Vitest for unit tests, Playwright for E2E
## Conventions
- Components are named with PascalCase and live in `src/components/`
- Server actions live in `src/actions/` with the suffix `Action`
- Database queries stay in `src/db/queries/` — never inline in components
- Always use named exports, never default exports for components
## Code Style
- Prefer `const` arrow functions
- No `any` — use `unknown` and narrow with type guards
- Error handling: throw typed errors, catch at the boundary (route handler or action)
## Do Not
- Do not use `useEffect` for data fetching
- Do not add barrel `index.ts` files
- Do not write class-based React componentsCopilot reads this file for every request in that repository. Instructions apply to inline completions, chat responses, and agent mode.
In VS Code Settings (Cmd+,), search for "Copilot Instructions". You can add personal preferences that apply across all projects — your preferred variable naming style, language preferences, etc.
Prefer functional programming patterns. Always include JSDoc for public APIs.
Use early returns to reduce nesting.
Prompt files are reusable chat templates saved as .prompt.md files in .github/prompts/. They let you and your team standardize common AI-assisted tasks.
<!-- .github/prompts/create-api-endpoint.prompt.md -->
---
mode: agent
description: Scaffold a new REST API endpoint
---
Create a new API endpoint for the **${input:Resource name}** resource.
Follow these steps:
1. Add a route file at `src/app/api/${input:route path}/route.ts`
2. Implement GET, POST handlers with proper error handling
3. Add Zod validation schema for POST body
4. Add a database query in `src/db/queries/${input:resource}.ts`
5. Write unit tests in `__tests__/api/${input:resource}.test.ts`
Use the existing `src/app/api/users/route.ts` as a reference for code style.In VS Code Copilot Chat, type / and start typing the prompt file name. Copilot lists available prompts from .github/prompts/. Select one to load it — the ${input:...} placeholders become fields you fill in before sending.
This lets your team build a library of standardized AI workflows for things like:
Prompt files with mode: agent automatically activate agent mode when selected. Use mode: ask for chat-only prompts.
Copilot supports Model Context Protocol (MCP) servers, which extend its capabilities with external tools and data sources. In VS Code, configure MCP servers via the Copilot settings UI or in .vscode/mcp.json.
Open the VS Code command palette (Cmd+Shift+P) and run "GitHub Copilot: Configure MCP Servers", or create .vscode/mcp.json:
{
"servers": {
"github": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_TOKEN": "${env:GITHUB_TOKEN}"
}
},
"postgres": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-postgres",
"postgresql://localhost/mydb"
]
}
}
}Once connected, Copilot can use these servers in agent mode. Ask questions in natural language:
What are the 5 most recent GitHub issues tagged "bug" in this repo?
How many orders came in today?
Copilot calls the appropriate MCP tool, gets the data, and incorporates it into its response.
Copilot Spaces (available on Business and Enterprise plans) are shareable AI workspaces that combine:
Use Spaces to create dedicated AI environments for specific workflows: an API design space, a debugging space, a documentation space. Each space maintains context across sessions and across team members.
Copilot Spaces is an Enterprise-tier feature. Check your plan at github.com/settings/copilot before attempting to create one.
Copilot Memory (in preview as of 2025) automatically remembers information you share across sessions:
Memory persists at the user level — not per-repository. You can view and delete memories in your Copilot settings at github.com/settings/copilot/memory.
Custom instructions eliminate repetitive context-setting. Prompt files standardize common AI workflows for your team. MCP servers connect Copilot to your databases, APIs, and external tools. Together these features shift Copilot from a generic assistant to a deeply context-aware collaborator that understands your specific project, stack, and conventions.