copilot-spaces by github/awesome-copilot
npx skills add https://github.com/github/awesome-copilot --skill copilot-spaces使用 Copilot Spaces 将精选的、特定于项目的上下文引入对话中。Space 是一个共享的仓库、文件、文档和指令集合,它将 Copilot 的响应锚定在您团队的实际代码和知识中。
| 工具 | 用途 |
|---|---|
mcp__github__list_copilot_spaces | 列出当前用户可访问的所有空间 |
mcp__github__get_copilot_space | 通过所有者和名称加载空间的完整上下文 |
gh api 的 REST API(完整 CRUD)Spaces REST API 支持创建、更新、删除空间以及管理协作者。MCP 服务器仅公开读取操作,因此请使用 gh api 进行写入操作。
用户空间:
| 方法 |
|---|
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 端点 |
|---|
| 用途 |
|---|
POST | /users/{username}/copilot-spaces | 创建空间 |
GET | /users/{username}/copilot-spaces | 列出空间 |
GET | /users/{username}/copilot-spaces/{number} | 获取空间 |
PUT | /users/{username}/copilot-spaces/{number} | 更新空间 |
DELETE | /users/{username}/copilot-spaces/{number} | 删除空间 |
组织空间: 在 /orgs/{org}/copilot-spaces/... 下遵循相同模式
协作者: 在 .../collaborators 处添加、列出、更新和移除协作者
范围要求: PAT 需要 read:user 用于读取,user 用于写入。使用 gh auth refresh -h github.com -s user 添加。
注意: 此 API 功能正常但尚未进入公共 REST API 文档。它可能需要 copilot_spaces_api 功能标志。
当用户询问有哪些空间可用或您需要找到合适的空间时:
Call mcp__github__list_copilot_spaces
这将返回用户可以访问的所有空间,每个空间都有 name 和 owner_login。向用户展示相关的匹配项。
要筛选特定用户的空间,请将 owner_login 与用户名匹配(例如,“显示我的空间”)。
当用户指定一个特定空间或您已确定正确的空间时:
Call mcp__github__get_copilot_space with:
owner: "org-or-user" (the owner_login from the list)
name: "Space Name" (exact space name, case-sensitive)
这将返回空间的完整内容:附加的文档、代码上下文、自定义指令以及任何其他精选材料。使用此上下文来指导您的回答。
空间内容通常引用外部资源:GitHub issues、仪表板、仓库、讨论或其他工具。主动使用其他 MCP 工具获取这些资源以收集完整上下文。例如:
issue_read 获取最新评论。get_file_contents 读取它。加载后,根据空间包含的内容使用它:
如果空间包含参考资料(文档、代码、标准):
如果空间包含工作流程指令(模板、分步流程):
gh api)当用户想要创建、更新或删除空间时,使用 gh api。首先,从列表端点找到空间编号。
更新空间的指令:
gh api users/{username}/copilot-spaces/{number} \
-X PUT \
-f general_instructions="New instructions here"
同时更新名称、描述或指令:
gh api users/{username}/copilot-spaces/{number} \
-X PUT \
-f name="Updated Name" \
-f description="Updated description" \
-f general_instructions="Updated instructions"
创建新空间:
gh api users/{username}/copilot-spaces \
-X POST \
-f name="My New Space" \
-f general_instructions="Help me with..." \
-f visibility="private"
附加资源(替换整个资源列表):
{
"resources_attributes": [
{ "resource_type": "free_text", "metadata": { "name": "Notes", "text": "Content here" } },
{ "resource_type": "github_issue", "metadata": { "repository_id": 12345, "number": 42 } },
{ "resource_type": "github_file", "metadata": { "repository_id": 12345, "file_path": "docs/guide.md" } }
]
}
删除空间:
gh api users/{username}/copilot-spaces/{number} -X DELETE
可更新字段: name, description, general_instructions, icon_type, icon_color, visibility ("private"/"public"), base_role ("no_access"/"reader"), resources_attributes
用户 : "加载 Accessibility copilot space"
操作 :
"github" 和名称 "Accessibility" 调用 mcp__github__get_copilot_space用户 : "我们团队有哪些可用的 copilot spaces?"
操作 :
mcp__github__list_copilot_spaces用户 : "使用 security space,我们关于秘密扫描的策略是什么?"
操作 :
mcp__github__get_copilot_space用户 : "使用 PM Weekly Updates space 撰写我的每周更新"
操作 :
mcp__github__get_copilot_space 加载空间。它包含一个模板格式和分步指令。用户 : "更新我的 PM Weekly Updates space,以包含一个新的写作指南"
操作 :
调用 mcp__github__list_copilot_spaces 并找到空间编号(例如,19)。
调用 mcp__github__get_copilot_space 读取当前指令。
按请求修改指令文本。
推送更新:
gh api users/labudis/copilot-spaces/19 -X PUT -f general_instructions="updated instructions..."
list_copilot_spaces 中的确切名称。owner 和 name。gh api 用于创建/更新/删除)需要 user PAT 范围。如果在写入操作时收到 404,请运行 gh auth refresh -h github.com -s user。{ "id": 123, "_destroy": true }。每周安装量
2.9K
仓库
GitHub Stars
26.7K
首次出现
Mar 5, 2026
安全审计
安装于
codex2.9K
gemini-cli2.9K
opencode2.8K
cursor2.8K
github-copilot2.8K
kimi-cli2.8K
Use Copilot Spaces to bring curated, project-specific context into conversations. A Space is a shared collection of repositories, files, documentation, and instructions that grounds Copilot responses in your team's actual code and knowledge.
| Tool | Purpose |
|---|---|
mcp__github__list_copilot_spaces | List all spaces accessible to the current user |
mcp__github__get_copilot_space | Load a space's full context by owner and name |
gh api (Full CRUD)The Spaces REST API supports creating, updating, deleting spaces, and managing collaborators. The MCP server only exposes read operations, so use gh api for writes.
User Spaces:
| Method | Endpoint | Purpose |
|---|---|---|
POST | /users/{username}/copilot-spaces | Create a space |
GET | /users/{username}/copilot-spaces | List spaces |
GET | /users/{username}/copilot-spaces/{number} | Get a space |
PUT |
Organization Spaces: Same pattern under /orgs/{org}/copilot-spaces/...
Collaborators: Add, list, update, and remove collaborators at .../collaborators
Scope requirements: PAT needs read:user for reads, user for writes. Add with gh auth refresh -h github.com -s user.
Note: This API is functional but not yet in the public REST API docs. It may require the copilot_spaces_api feature flag.
When a user asks what spaces are available or you need to find the right space:
Call mcp__github__list_copilot_spaces
This returns all spaces the user can access, each with a name and owner_login. Present relevant matches to the user.
To filter for a specific user's spaces, match owner_login against the username (e.g., "show me my spaces").
When a user names a specific space or you've identified the right one:
Call mcp__github__get_copilot_space with:
owner: "org-or-user" (the owner_login from the list)
name: "Space Name" (exact space name, case-sensitive)
This returns the space's full content: attached documentation, code context, custom instructions, and any other curated materials. Use this context to inform your responses.
Space content often references external resources: GitHub issues, dashboards, repos, discussions, or other tools. Proactively fetch these using other MCP tools to gather complete context. For example:
issue_read to get the latest comments.get_file_contents to read it.Once loaded, use the space content based on what it contains:
If the space contains reference material (docs, code, standards):
If the space contains workflow instructions (templates, step-by-step processes):
gh api)When a user wants to create, update, or delete a space, use gh api. First, find the space number from the list endpoint.
Update a space's instructions:
gh api users/{username}/copilot-spaces/{number} \
-X PUT \
-f general_instructions="New instructions here"
Update name, description, or instructions together:
gh api users/{username}/copilot-spaces/{number} \
-X PUT \
-f name="Updated Name" \
-f description="Updated description" \
-f general_instructions="Updated instructions"
Create a new space:
gh api users/{username}/copilot-spaces \
-X POST \
-f name="My New Space" \
-f general_instructions="Help me with..." \
-f visibility="private"
Attach resources (replaces entire resource list):
{
"resources_attributes": [
{ "resource_type": "free_text", "metadata": { "name": "Notes", "text": "Content here" } },
{ "resource_type": "github_issue", "metadata": { "repository_id": 12345, "number": 42 } },
{ "resource_type": "github_file", "metadata": { "repository_id": 12345, "file_path": "docs/guide.md" } }
]
}
Delete a space:
gh api users/{username}/copilot-spaces/{number} -X DELETE
Updatable fields: name, description, general_instructions, icon_type, icon_color, visibility ("private"/"public"), base_role ("no_access"/"reader"), resources_attributes
User : "Load the Accessibility copilot space"
Action :
mcp__github__get_copilot_space with owner "github", name "Accessibility"User : "What copilot spaces are available for our team?"
Action :
mcp__github__list_copilot_spacesUser : "Using the security space, what's our policy on secret scanning?"
Action :
mcp__github__get_copilot_space with the appropriate owner and nameUser : "Write my weekly update using the PM Weekly Updates space"
Action :
mcp__github__get_copilot_space to load the space. It contains a template format and step-by-step instructions.User : "Update my PM Weekly Updates space to include a new writing guideline"
Action :
mcp__github__list_copilot_spaces and find the space number (e.g., 19).mcp__github__get_copilot_space to read current instructions.gh api users/labudis/copilot-spaces/19 -X PUT -f general_instructions="updated instructions..."
list_copilot_spaces.owner and name.gh api for create/update/delete) require the user PAT scope. If you get a 404 on write operations, run gh auth refresh -h github.com -s user.{ "id": 123, "_destroy": true } in the array.Weekly Installs
2.9K
Repository
GitHub Stars
26.7K
First Seen
Mar 5, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
codex2.9K
gemini-cli2.9K
opencode2.8K
cursor2.8K
github-copilot2.8K
kimi-cli2.8K
97,600 周安装
/users/{username}/copilot-spaces/{number} |
| Update a space |
DELETE | /users/{username}/copilot-spaces/{number} | Delete a space |