Skip to content

Commit 6c48a1e

Browse files
Add MCP OAuth callback metadata
1 parent df1d8e3 commit 6c48a1e

3 files changed

Lines changed: 60 additions & 0 deletions

File tree

.well-known/apple-app-site-association

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,10 @@
1717
]
1818
}
1919
]
20+
},
21+
"webcredentials": {
22+
"apps": [
23+
"8GYAXFCC2W.app.pythonide"
24+
]
2025
}
2126
}

mcp-oauth/callback/index.html

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<!doctype html>
2+
<html lang="zh-CN">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<meta name="referrer" content="no-referrer">
7+
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'unsafe-inline'; style-src 'unsafe-inline'; base-uri 'none'; form-action 'none'">
8+
<title>返回 PythonIDE</title>
9+
<style>
10+
:root { color-scheme: light dark; font-family: -apple-system, BlinkMacSystemFont, sans-serif; }
11+
body { min-height: 100vh; margin: 0; display: grid; place-items: center; background: Canvas; color: CanvasText; }
12+
main { width: min(30rem, calc(100% - 3rem)); text-align: center; }
13+
h1 { font-size: 1.35rem; margin: 0 0 .6rem; }
14+
p { color: GrayText; line-height: 1.55; }
15+
a { display: inline-block; margin-top: 1rem; padding: .75rem 1rem; border-radius: 999px; background: #0a84ff; color: white; text-decoration: none; }
16+
</style>
17+
</head>
18+
<body>
19+
<main>
20+
<h1>正在返回 PythonIDE…</h1>
21+
<p id="status">请稍候,不要关闭此页面。</p>
22+
<a id="continue" hidden>返回 PythonIDE</a>
23+
</main>
24+
<script>
25+
(() => {
26+
const status = document.getElementById('status');
27+
const button = document.getElementById('continue');
28+
if (!window.location.search) {
29+
status.textContent = '授权响应无效,请返回 PythonIDE 后重试。';
30+
return;
31+
}
32+
const destination = `pythonide://mcp-oauth/callback${window.location.search}`;
33+
button.href = destination;
34+
button.hidden = false;
35+
window.location.replace(destination);
36+
})();
37+
</script>
38+
</body>
39+
</html>

mcp-oauth/client.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"client_id": "https://link.pythonide.xin/mcp-oauth/client.json",
3+
"client_name": "PythonIDE",
4+
"client_uri": "https://pythonide.xin/",
5+
"redirect_uris": [
6+
"https://link.pythonide.xin/mcp-oauth/callback"
7+
],
8+
"grant_types": [
9+
"authorization_code",
10+
"refresh_token"
11+
],
12+
"response_types": [
13+
"code"
14+
],
15+
"token_endpoint_auth_method": "none"
16+
}

0 commit comments

Comments
 (0)