Elffuss BraidHub

kikocis/continue public

main · 5.5 KiBRawPermalink
1---
2title: "Context Providers"
3description: "Context Providers allow you to type '@' and see a dropdown of content that can all be provided to the model as context."
4---
5
6Context Providers allow you to type '@' and see a dropdown of content that can all be provided to the model as context.
7
8![Context Items](/images/customize/images/context-provider-example-0c96ff77286fa970b23dddfdc1fa986a.png)
9
10## Built-in Context Providers
11
12You can add any built-in context-providers in your config file as shown below:
13
14### `@File`
15
16Reference any file in your current workspace.
17
18```yaml config.yaml
19context:
20 - provider: file
21```
22
23### `@Code`
24
25Reference specific functions or classes from throughout your project.
26
27```yaml config.yaml
28context:
29 - provider: code
30```
31
32### `@Git Diff`
33
34Reference 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.
35
36```yaml config.yaml
37context:
38 - provider: diff
39```
40
41### `@Current File`
42
43Reference the currently open file.
44
45```yaml config.yaml
46context:
47 - provider: currentFile
48```
49
50### `@Terminal`
51
52Reference the last command you ran in your IDE's terminal and its output.
53
54```yaml config.yaml
55context:
56 - provider: terminal
57```
58
59### `@Open`
60
61Reference the contents of all of your open files. Set `onlyPinned` to `true` to only reference pinned files.
62
63```yaml config.yaml
64context:
65 - provider: open
66 params:
67 onlyPinned: true
68```
69
70### `@Clipboard`
71
72Reference recent clipboard items
73
74```yaml config.yaml
75context:
76 - provider: clipboard
77```
78
79### `@Tree`
80
81Reference the structure of your current workspace.
82
83```yaml config.yaml
84context:
85 - provider: tree
86```
87
88### `@Problems`
89
90Get Problems from the current file.
91
92```yaml config.yaml
93context:
94 - provider: problems
95```
96
97### `@Debugger`
98
99Reference the contents of the local variables in the debugger. Currently only available in VS Code.
100
101```yaml config.yaml
102context:
103 - provider: debugger
104 params:
105 stackDepth: 3
106```
107
108Uses the top _n_ levels (defaulting to 3) of the call stack for that thread.
109
110### `@Repository Map`
111
112Reference the outline of your codebase. By default, signatures are included along with file in the repo map.
113
114`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.
115
116```yaml config.yaml
117context:
118 - provider: repo-map
119 params:
120 includeSignatures: false # default true
121```
122
123Provides 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.
124
125In the submenu that appears, you can select either `Entire codebase`, or specify a subfolder to generate the repostiory map from.
126
127This context provider is inpsired by [Aider's repository map](https://aider.chat/2023/10/22/repomap.html).
128
129### `@Operating System`
130
131Reference the architecture and platform of your current operating system.
132
133```yaml config.yaml
134context:
135 - provider: os
136```
137
138### `@HTTP`
139
140The HttpContextProvider makes a POST request to the url passed in the configuration. The server must return 200 OK with a ContextItem object or an array of ContextItems.
141
142```yaml config.yaml
143context:
144 - provider: http
145 params:
146 url: "https://api.example.com/v1/users"
147 headers:
148 - Authorization: "Bearer <token>"
149```
150
151The receiving URL should expect to receive the following parameters:
152
153POST parameters
154
155```json
156{ query: string, fullInput: string}
157```
158
159The response 200 OK should be a JSON object with the following structure:
160
161Response
162
163```
164[ { "name": "", "description": "", "content": "" }]// OR{ "name": "", "description": "", "content": ""}
165```
166
167### Model Context Protocol
168
169The [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:
170
171```yaml config.yaml
172mcpServers:
173 - name: My MCP Server
174 command: uvx
175 args:
176 - mcp-server-sqlite
177 - --db-path
178 - /Users/NAME/test.db
179```
180
181You'll then be able to type "@" and see "MCP" in the context providers dropdown.
182
183## Deprecated Context Providers
184
185<Note>
186 To provide conext beyond the built-in context providers, we now recommend
187 using [MCP Servers](/customization/mcp-tools)
188</Note>
189
190View the [deprecated context providers](/reference/deprecated-context-providers) for documentation on:
191
192- [`@Codebase`](/reference/deprecated-codebase) - Use the [codebase awareness guide](/guides/codebase-documentation-awareness) instead
193- [`@Folder`](/reference/deprecated-codebase) - Use the [codebase awareness guide](/guides/codebase-documentation-awareness) instead
194- [`@Docs`](/reference/deprecated-docs) - Use the [documentation awareness guide](/guides/codebase-documentation-awareness) instead
195- `@Greptile` - Query Greptile index
196- `@Commits` - Reference git commits
197- `@Discord` - Reference Discord messages
198- `@Jira` - Reference Jira issues
199- `@Gitlab Merge Request` - Reference GitLab MRs
200- `@Google` - Google search results
201- `@Database` - Database schemas
202- `@Issue` - GitHub issues
203- `@Url` - URL content
204- `@Search` - Codebase search
205- `@Web` - Web search results