Elffuss BraidHub

kikocis/continue public

main · 6.9 KiBRawPermalink
1---
2title: "Context Providers"
3description: "Context Providers allow you to type '@' and see a dropdown of content that can all be fed to the LLM as context. Every context provider is a plugin, which means if you want to reference some source of information that you don't see here, you can request (or build!) a new context provider."
4---
5
6As an example, say you are working on solving a new GitHub Issue. You type '@Issue' and select the one you are working on. Continue can now see the issue title and contents. You also know that the issue is related to the files 'readme.md' and 'helloNested.py', so you type '@readme' and '@hello' to find and select them. Now these 3 "Context Items" are displayed inline with the rest of your input.
7
8![Context Items](/images/customize/images/context-provider-example-0c96ff77286fa970b23dddfdc1fa986a.png)
9
10## How Do Context Blocks Work?
11
12You can add context providers to assistants using [`context` blocks](/hub/blocks/block-types#context). Explore available context blocks in [the hub](https://hub.continue.dev/explore/context).
13
14## Built-in Context Providers
15
16You can add any built-in context-providers in your config file as shown below:
17
18### @File Context Provider – Reference Files in Your Workspace
19
20Reference any file in your current workspace.
21
22config.yaml
23
24```
25context: - provider: file
26```
27
28### @Code Context Provider – Reference Functions and Classes
29
30Reference specific functions or classes from throughout your project.
31
32config.yaml
33
34```
35context: - provider: code
36```
37
38### @Git Diff Context Provider – Reference Branch Changes
39
40Reference all of the changes you've made to your current branch. This is useful if you want to summarize what you've done or ask for a general review of your work before committing.
41
42config.yaml
43
44```
45context: - provider: diff
46```
47
48### @Current File Context Provider – Reference the Active File
49
50Reference the currently open file.
51
52config.yaml
53
54```
55context: - provider: currentFile
56```
57
58### @Terminal Context Provider – Reference Last Terminal Command and Output
59
60Reference the last command you ran in your IDE's terminal and its output.
61
62config.yaml
63
64```
65context: - provider: terminal
66```
67
68### @Docs Context Provider – Reference Documentation Site Content
69
70Reference the contents from any documentation site.
71
72config.yaml
73
74```
75context: - provider: docs
76```
77
78Note that this will only enable the `@Docs` context provider.
79
80To use it, you need to add a documentation site to your config file. See the [docs](/customize/overview#documentation-context) page for more information.
81
82### @Open Context Provider – Reference All Open Files or Pinned Files
83
84Reference the contents of all of your open files. Set `onlyPinned` to `true` to only reference pinned files.
85
86config.yaml
87
88```
89context:
90 - provider: open
91 params:
92 onlyPinned: true
93```
94
95### @Web Context Provider – Reference Relevant Web Pages
96
97Reference relevant pages from across the web, automatically determined from your input.
98
99Optionally, set `n` to limit the number of results returned (default 6).
100
101config.yaml
102
103```
104context:
105 - provider: web
106 params:
107 n: 5
108```
109
110### @Codebase Context Provider – Reference Relevant Codebase Snippets
111
112Reference the most relevant snippets from your codebase.
113
114config.yaml
115
116```
117context:
118 - provider: codebase
119```
120
121Read more about indexing and retrieval [here](/customize/overview#codebase-context).
122
123### @Folder Context Provider – Reference Code from a Specific Folder
124
125Uses the same retrieval mechanism as `@Codebase`, but only on a single folder.
126
127config.yaml
128
129```
130context: - provider: folder
131```
132
133### @Search Context Provider – Reference Code Search Results
134
135Reference the results of codebase search, just like the results you would get from VS Code search.
136
137config.yaml
138
139```
140context:
141 - provider: search
142 params:
143 maxResults: 100 # optional, defaults to 200
144```
145
146This context provider is powered by [ripgrep](https://github.com/BurntSushi/ripgrep).
147
148### @Url Context Provider – Reference Content from a URL
149
150Reference the markdown converted contents of a given URL.
151
152config.yaml
153
154```
155context:
156 - provider: url
157```
158
159### @Clipboard Context Provider – Reference Clipboard Items
160
161Reference recent clipboard items
162
163config.yaml
164
165```
166context:
167 - provider: clipboard
168```
169
170### @Tree Context Provider – Reference Workspace File Structure
171
172Reference the structure of your current workspace.
173
174config.yaml
175
176```
177context:
178 - provider: tree
179```
180
181### @Problems Context Provider – Reference Problems in the Current File
182
183Get Problems from the current file.
184
185config.yaml
186
187```
188context:
189 - provider: problems
190```
191
192### @Debugger Context Provider – Reference Debugger Local Variables
193
194Reference the contents of the local variables in the debugger. Currently only available in VS Code.
195
196config.yaml
197
198```
199context:
200 - provider: debugger
201 params:
202 stackDepth: 3
203```
204
205Uses the top _n_ levels (defaulting to 3) of the call stack for that thread.
206
207### @Repository Map Context Provider – Reference Codebase Outline and Signatures
208
209Reference the outline of your codebase. By default, signatures are included along with file in the repo map.
210
211`includeSignatures` params can be set to false to exclude signatures. This could be necessary for large codebases and/or to reduce context size significantly. Signatures will not be included if indexing is disabled.
212
213config.yaml
214
215```
216context:
217 - provider: repo-map
218 params:
219 includeSignatures: false # default true
220```
221
222Provides a list of files and the call signatures of top-level classes, functions, and methods in those files. This helps the model better understand how a particular piece of code relates to the rest of the codebase.
223
224In the submenu that appears, you can select either `Entire codebase`, or specify a subfolder to generate the repository map from.
225
226This context provider is inspired by [Aider's repository map](https://aider.chat/2023/10/22/repomap.html).
227
228### @Operating System Context Provider – Reference System Architecture and Platform
229
230Reference the architecture and platform of your current operating system.
231
232config.yaml
233
234```
235context:
236 - provider: os
237```
238
239### Using the Model Context Protocol (MCP) in Continue
240
241The [Model Context Protocol](https://modelcontextprotocol.io/introduction) is a standard proposed by Anthropic to unify prompts, context, and tool use. Continue supports any MCP server with the MCP context provider. Read their [quickstart](https://modelcontextprotocol.io/quickstart) to learn how to set up a local server and then set up your configuration like this:
242
243config.yaml
244
245```
246mcpServers:
247 - name: My MCP Server
248 command: uvx
249 args:
250 - mcp-server-sqlite
251 - --db-path
252 - /Users/NAME/test.db
253```
254
255You'll then be able to type "@" and see "MCP" in the context providers dropdown.
256
257### How to Request a New Context Provider in Continue
258
259Not seeing what you want? Create an issue [here](https://github.com/continuedev/continue/issues/new?assignees=TyDunn&labels=enhancement&projects=&template=feature-request-%F0%9F%92%AA.md&title=) to request a new Context Provider.