chore: archive development research artifacts and debug scripts

This commit is contained in:
fujie
2026-02-07 12:49:42 +08:00
parent 89a12a4fe8
commit 795ac34cd9
25 changed files with 2855 additions and 0 deletions

47
plugins/debug/mcp_test.py Normal file
View File

@@ -0,0 +1,47 @@
import asyncio
import os
from copilot import CopilotClient
async def main():
token = os.getenv("GH_TOKEN") or os.getenv("GITHUB_TOKEN")
if not token:
print(
"Error: GH_TOKEN (or GITHUB_TOKEN) environment variable not set. Please export GH_TOKEN=... before running."
)
return
client = CopilotClient()
await client.start()
async def on_permission_request(request, _ctx):
if request.get("kind") == "mcp":
return {"kind": "approved"}
return {"kind": "approved"}
session = await client.create_session(
{
"model": "gpt-5-mini",
"mcp_servers": {
"github": {
"type": "http",
"url": "https://api.githubcopilot.com/mcp/",
"headers": {"Authorization": f"Bearer {token}"},
"tools": ["*"],
}
}
}
)
result = await session.send_and_wait(
{
"prompt": "Use GitHub MCP tools to find the owner of the 'awesome-openwebui' repository.",
},timeout=1000
)
print(result.data.content)
await client.stop()
if __name__ == "__main__":
asyncio.run(main())