# How to teach GitHub Copilot your knowledge

Give Copilot project guidance in Markdown instruction files, then add an [MCP server](https://www.knowman.io/guides/mcp-server-knowledge-base) when you want access to tools or data sources. You can connect KnowMan's documented hosted MCP endpoint and ask Copilot to [search your saved](https://www.knowman.io/guides/ai-knowledge-base) reading, subject to the client setup described in [VS Code's MCP documentation](https://code.visualstudio.com/docs/copilot/customization/mcp-servers) and the [KnowMan MCP README](https://github.com/Essatt/knowman-mcp).

## Write project instructions

Put reusable project guidance in Markdown files, such as where code belongs, which libraries to use, and which tests to run. Share these files through source control so the guidance stays with the project. [VS Code custom instructions](https://code.visualstudio.com/docs/copilot/customization/custom-instructions)

Copilot supports `.github/copilot-instructions.md` or `AGENTS.md` for project instructions. The selected agent harness determines which instruction files it reads. VS Code [custom instructions](https://www.knowman.io/guides/give-your-ai-context)

These files do not need frontmatter. Instructions guide behavior, but do not guarantee compliance or replace tests, code review, or security controls. They also do not apply to inline suggestions as you type. VS Code custom instructions

## Use targeted instructions for specific files

An `.instructions.md` file can use `applyTo` to target files. In Local sessions, a `description` lets the agent decide whether to read an instructions file for a task. VS Code custom instructions

Use instruction files for coding conventions or project context. For a reusable multi-step workflow, VS Code suggests an agent skill instead. VS Code custom instructions

## Choose the right customization

VS Code's Agent Customizations editor includes instructions, skills, custom agents, hooks, and MCP servers. Use instructions for project guidance, and use an MCP server to connect agents to tools and data sources. [Customization overview](https://code.visualstudio.com/docs/copilot/customization/overview) and MCP servers

## Add an MCP server in VS Code

To add a server manually, open MCP Servers, select Add Server in the User or Workspace group, then follow the guided flow. A remote server can use an HTTP or Server-Sent Events endpoint. Customization overview and MCP servers

VS Code also documents a [local server](https://www.knowman.io/guides/what-is-an-mcp-server) option that starts a command and communicates over standard input and output. Local MCP servers can run code on your machine and access external services with your permissions, so review the publisher and requested access. MCP servers

## Connect KnowMan to your saved reading

KnowMan's hosted MCP server is at `https://api.knowman.io/mcp` and uses Streamable HTTP. Hosted access supports OAuth approval or an API key sent as an Authorization bearer token. KnowMan MCP README

Add the endpoint through VS Code's guided MCP server flow. If the client offers OAuth, [sign in](https://www.knowman.io/guides/personal-knowledge-base) to KnowMan and approve access; otherwise, use the documented bearer-key method where the client supports it. KnowMan's OAuth consent distinguishes read access for searching, reading, and asking from write access for saving links. KnowMan MCP README and VS Code customization overview

Once connected, ask Copilot to search your KnowMan for a topic or to [save a URL](https://www.knowman.io/guides/how-to-save-articles). KnowMan's six MCP tools include search, ask, item retrieval, saving, recent items, and read-only memories. KnowMan MCP README

## Where KnowMan fits

Instruction files hold project guidance. KnowMan saves articles and links, reads and tags them, answers questions with citations, and keeps memories such as claims, decisions, and playbooks. Its MCP gives an assistant tools to search and ask about that saved knowledge. KnowMan MCP README

The supplied VS Code documents explain how to configure MCP servers, but do not describe how retrieved MCP knowledge persists between sessions. Ask Copilot to use KnowMan when you want it to search your [saved reading](https://www.knowman.io/guides/ai-article-saver). See the [MCP server knowledge base guide](https://www.knowman.io/guides/mcp-server-knowledge-base) and knowledge bases for [AI agents](https://www.knowman.io/guides/knowledge-base-for-ai-agents).

## Questions

### Which instruction file should I use for GitHub Copilot?

VS Code documents `.github/copilot-instructions.md` and `AGENTS.md` for Copilot harnesses. The selected harness determines which instruction files it reads. VS Code custom instructions

### Can instructions target only some files?

Yes. An `.instructions.md` file can use `applyTo` to match files. In Local sessions, a `description` can help the agent decide whether to read the file for a task. VS Code custom instructions

### How do I connect KnowMan to Copilot?

KnowMan documents a hosted MCP endpoint at `https://api.knowman.io/mcp`, with OAuth approval or an API key sent as a bearer token. VS Code documents a guided flow for adding MCP servers at user or workspace scope. KnowMan MCP README and VS Code customization overview

### Will Copilot remember KnowMan results in future chats?

The supplied VS Code documentation does not describe whether MCP results persist as future instructions. Ask Copilot to search KnowMan when you want it to use your saved reading. VS Code MCP servers

## Related guides

- [Add your knowledge base to GitHub Copilot](https://www.knowman.io/guides/github-copilot-knowledge-base)

- [Connect your knowledge base through KnowMan's MCP server](https://www.knowman.io/guides/mcp-server-knowledge-base)

- [How Do You Connect AI to Your Notes?](https://www.knowman.io/guides/connect-any-ai-to-your-notes)

- [What Is a Knowledge Base for AI Agents?](https://www.knowman.io/guides/knowledge-base-for-ai-agents)

## More in this topic

- [How to teach LM Studio your knowledge](https://www.knowman.io/guides/teach-lm-studio-your-knowledge)
- [How to teach LibreChat your knowledge](https://www.knowman.io/guides/teach-librechat-your-knowledge)
- [How to teach Jan your knowledge](https://www.knowman.io/guides/teach-jan-your-knowledge)

## More for GitHub Copilot

- [KnowMan MCP server for GitHub Copilot](https://www.knowman.io/integrations/github-copilot)
- [How to give GitHub Copilot better memory](https://www.knowman.io/guides/github-copilot-memory)

## Give your reading a place to live

Try KnowMan Pro for 14 days with no credit card. [Create your account](https://app.knowman.io/signup)

[Start free](https://app.knowman.io/signup)

Every new account starts with 14 days of Pro. No credit card.

Source: https://www.knowman.io/guides/teach-github-copilot-your-knowledge
