@interface-db/mcp 1.0.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +202 -0
- package/NOTICE +4 -0
- package/README.md +105 -0
- package/dist/crypto.d.ts +16 -0
- package/dist/crypto.d.ts.map +1 -0
- package/dist/crypto.js +45 -0
- package/dist/crypto.js.map +1 -0
- package/dist/db/instant.perms.d.ts +9 -0
- package/dist/db/instant.perms.d.ts.map +1 -0
- package/dist/db/instant.perms.js +10 -0
- package/dist/db/instant.perms.js.map +1 -0
- package/dist/db/instant.schema.d.ts +162 -0
- package/dist/db/instant.schema.d.ts.map +1 -0
- package/dist/db/instant.schema.js +167 -0
- package/dist/db/instant.schema.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.html.d.ts +3 -0
- package/dist/index.html.d.ts.map +1 -0
- package/dist/index.html.js +111 -0
- package/dist/index.html.js.map +1 -0
- package/dist/index.js +456 -0
- package/dist/index.js.map +1 -0
- package/dist/oauth-service-provider.d.ts +37 -0
- package/dist/oauth-service-provider.d.ts.map +1 -0
- package/dist/oauth-service-provider.js +603 -0
- package/dist/oauth-service-provider.js.map +1 -0
- package/dist/schema.d.ts +29 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +52 -0
- package/dist/schema.js.map +1 -0
- package/dist/tools.d.ts +12 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +72 -0
- package/dist/tools.js.map +1 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +3 -0
- package/dist/version.js.map +1 -0
- package/package.json +68 -0
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
// Docs: https://www.interfacedb.com/docs/modeling-data
|
|
2
|
+
import { i } from '@interface-db/core';
|
|
3
|
+
const _schema = i.schema({
|
|
4
|
+
// We inferred 4 attributes!
|
|
5
|
+
// Take a look at this schema, and if everything looks good,
|
|
6
|
+
// run `push schema` again to enforce the types.
|
|
7
|
+
entities: {
|
|
8
|
+
$files: i.entity({
|
|
9
|
+
path: i.string().unique().indexed(),
|
|
10
|
+
url: i.string(),
|
|
11
|
+
}),
|
|
12
|
+
$users: i.entity({
|
|
13
|
+
email: i.string().unique().indexed().optional(),
|
|
14
|
+
}),
|
|
15
|
+
clients: i.entity({
|
|
16
|
+
client_id: i.string().unique().indexed(),
|
|
17
|
+
client_id_issued_at: i.number().optional(),
|
|
18
|
+
client_name: i.string().optional(),
|
|
19
|
+
client_secret: i.string().optional(),
|
|
20
|
+
client_secret_expires_at: i.number().optional(),
|
|
21
|
+
client_uri: i.string().optional(),
|
|
22
|
+
contacts: i.any().optional(),
|
|
23
|
+
grant_types: i.json().optional(),
|
|
24
|
+
jwks: i.any().optional(),
|
|
25
|
+
jwks_uri: i.string().optional(),
|
|
26
|
+
logo_uri: i.string().optional(),
|
|
27
|
+
policy_uri: i.string().optional(),
|
|
28
|
+
redirect_uris: i.json().optional(),
|
|
29
|
+
response_types: i.json().optional(),
|
|
30
|
+
scope: i.string().optional(),
|
|
31
|
+
software_id: i.string().optional(),
|
|
32
|
+
software_version: i.string().optional(),
|
|
33
|
+
token_endpoint_auth_method: i.string().optional(),
|
|
34
|
+
tos_uri: i.string().optional(),
|
|
35
|
+
}),
|
|
36
|
+
instantTokens: i.entity({
|
|
37
|
+
accessToken: i.string(),
|
|
38
|
+
expiresAt: i.date(),
|
|
39
|
+
refreshToken: i.string(),
|
|
40
|
+
}),
|
|
41
|
+
mcpRefreshTokens: i.entity({
|
|
42
|
+
scope: i.string(),
|
|
43
|
+
tokenHash: i.string().unique(),
|
|
44
|
+
}),
|
|
45
|
+
mcpTokens: i.entity({
|
|
46
|
+
expiresAt: i.date(),
|
|
47
|
+
scope: i.string(),
|
|
48
|
+
tokenHash: i.string().unique(),
|
|
49
|
+
}),
|
|
50
|
+
redirects: i.entity({
|
|
51
|
+
authParams: i.json(),
|
|
52
|
+
clientToken: i.string(),
|
|
53
|
+
cookieHash: i.string().indexed(),
|
|
54
|
+
exchangedForInstantCode: i.boolean().optional(),
|
|
55
|
+
expiresAt: i.date(),
|
|
56
|
+
instantCode: i.string().optional(),
|
|
57
|
+
mcpCodeHash: i.string().indexed().optional(),
|
|
58
|
+
shownConfirmPage: i.boolean().optional(),
|
|
59
|
+
state: i.string(),
|
|
60
|
+
}),
|
|
61
|
+
},
|
|
62
|
+
links: {
|
|
63
|
+
instantTokensClient: {
|
|
64
|
+
forward: {
|
|
65
|
+
on: 'instantTokens',
|
|
66
|
+
has: 'one',
|
|
67
|
+
label: 'client',
|
|
68
|
+
required: true,
|
|
69
|
+
onDelete: 'cascade',
|
|
70
|
+
},
|
|
71
|
+
reverse: {
|
|
72
|
+
on: 'clients',
|
|
73
|
+
has: 'many',
|
|
74
|
+
label: 'instantTokens',
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
mcpRefreshTokensClient: {
|
|
78
|
+
forward: {
|
|
79
|
+
on: 'mcpRefreshTokens',
|
|
80
|
+
has: 'one',
|
|
81
|
+
label: 'client',
|
|
82
|
+
required: true,
|
|
83
|
+
onDelete: 'cascade',
|
|
84
|
+
},
|
|
85
|
+
reverse: {
|
|
86
|
+
on: 'clients',
|
|
87
|
+
has: 'many',
|
|
88
|
+
label: 'mcpRefreshTokens',
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
mcpRefreshTokensInstantToken: {
|
|
92
|
+
forward: {
|
|
93
|
+
on: 'mcpRefreshTokens',
|
|
94
|
+
has: 'one',
|
|
95
|
+
label: 'instantToken',
|
|
96
|
+
required: true,
|
|
97
|
+
onDelete: 'cascade',
|
|
98
|
+
},
|
|
99
|
+
reverse: {
|
|
100
|
+
on: 'instantTokens',
|
|
101
|
+
has: 'one',
|
|
102
|
+
label: 'mcpRefreshToken',
|
|
103
|
+
onDelete: 'cascade',
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
mcpRefreshTokensMcpTokens: {
|
|
107
|
+
forward: {
|
|
108
|
+
on: 'mcpRefreshTokens',
|
|
109
|
+
has: 'many',
|
|
110
|
+
label: 'mcpTokens',
|
|
111
|
+
required: true,
|
|
112
|
+
},
|
|
113
|
+
reverse: {
|
|
114
|
+
on: 'mcpTokens',
|
|
115
|
+
has: 'one',
|
|
116
|
+
label: 'mcpRefreshToken',
|
|
117
|
+
onDelete: 'cascade',
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
mcpTokensClient: {
|
|
121
|
+
forward: {
|
|
122
|
+
on: 'mcpTokens',
|
|
123
|
+
has: 'one',
|
|
124
|
+
label: 'client',
|
|
125
|
+
required: true,
|
|
126
|
+
onDelete: 'cascade',
|
|
127
|
+
},
|
|
128
|
+
reverse: {
|
|
129
|
+
on: 'clients',
|
|
130
|
+
has: 'many',
|
|
131
|
+
label: 'mcpTokens',
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
mcpTokensInstantToken: {
|
|
135
|
+
forward: {
|
|
136
|
+
on: 'mcpTokens',
|
|
137
|
+
has: 'one',
|
|
138
|
+
label: 'instantToken',
|
|
139
|
+
required: true,
|
|
140
|
+
onDelete: 'cascade',
|
|
141
|
+
},
|
|
142
|
+
reverse: {
|
|
143
|
+
on: 'instantTokens',
|
|
144
|
+
has: 'many',
|
|
145
|
+
label: 'mcpTokens',
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
redirectsClient: {
|
|
149
|
+
forward: {
|
|
150
|
+
on: 'redirects',
|
|
151
|
+
has: 'one',
|
|
152
|
+
label: 'client',
|
|
153
|
+
required: true,
|
|
154
|
+
onDelete: 'cascade',
|
|
155
|
+
},
|
|
156
|
+
reverse: {
|
|
157
|
+
on: 'clients',
|
|
158
|
+
has: 'many',
|
|
159
|
+
label: 'redirects',
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
rooms: {},
|
|
164
|
+
});
|
|
165
|
+
const schema = _schema;
|
|
166
|
+
export default schema;
|
|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ACD,KAAK,EAAE,EAAE;CACV,CAAC,CAAC;AAKH,MAAM,MAAM,GAAc,OAAO,CAAC;AAGlC,eAAe,MAAM,CAAC","sourcesContent":["// Docs: https://www.interfacedb.com/docs/modeling-data\n\nimport { i } from '@interface-db/core';\n\nconst _schema = i.schema({\n // We inferred 4 attributes!\n // Take a look at this schema, and if everything looks good,\n // run `push schema` again to enforce the types.\n entities: {\n $files: i.entity({\n path: i.string().unique().indexed(),\n url: i.string(),\n }),\n $users: i.entity({\n email: i.string().unique().indexed().optional(),\n }),\n clients: i.entity({\n client_id: i.string().unique().indexed(),\n client_id_issued_at: i.number().optional(),\n client_name: i.string().optional(),\n client_secret: i.string().optional(),\n client_secret_expires_at: i.number().optional(),\n client_uri: i.string().optional(),\n contacts: i.any().optional(),\n grant_types: i.json().optional(),\n jwks: i.any().optional(),\n jwks_uri: i.string().optional(),\n logo_uri: i.string().optional(),\n policy_uri: i.string().optional(),\n redirect_uris: i.json().optional(),\n response_types: i.json().optional(),\n scope: i.string().optional(),\n software_id: i.string().optional(),\n software_version: i.string().optional(),\n token_endpoint_auth_method: i.string().optional(),\n tos_uri: i.string().optional(),\n }),\n instantTokens: i.entity({\n accessToken: i.string(),\n expiresAt: i.date(),\n refreshToken: i.string(),\n }),\n mcpRefreshTokens: i.entity({\n scope: i.string(),\n tokenHash: i.string().unique(),\n }),\n mcpTokens: i.entity({\n expiresAt: i.date(),\n scope: i.string(),\n tokenHash: i.string().unique(),\n }),\n redirects: i.entity({\n authParams: i.json(),\n clientToken: i.string(),\n cookieHash: i.string().indexed(),\n exchangedForInstantCode: i.boolean().optional(),\n expiresAt: i.date(),\n instantCode: i.string().optional(),\n mcpCodeHash: i.string().indexed().optional(),\n shownConfirmPage: i.boolean().optional(),\n state: i.string(),\n }),\n },\n links: {\n instantTokensClient: {\n forward: {\n on: 'instantTokens',\n has: 'one',\n label: 'client',\n required: true,\n onDelete: 'cascade',\n },\n reverse: {\n on: 'clients',\n has: 'many',\n label: 'instantTokens',\n },\n },\n mcpRefreshTokensClient: {\n forward: {\n on: 'mcpRefreshTokens',\n has: 'one',\n label: 'client',\n required: true,\n onDelete: 'cascade',\n },\n reverse: {\n on: 'clients',\n has: 'many',\n label: 'mcpRefreshTokens',\n },\n },\n mcpRefreshTokensInstantToken: {\n forward: {\n on: 'mcpRefreshTokens',\n has: 'one',\n label: 'instantToken',\n required: true,\n onDelete: 'cascade',\n },\n reverse: {\n on: 'instantTokens',\n has: 'one',\n label: 'mcpRefreshToken',\n onDelete: 'cascade',\n },\n },\n mcpRefreshTokensMcpTokens: {\n forward: {\n on: 'mcpRefreshTokens',\n has: 'many',\n label: 'mcpTokens',\n required: true,\n },\n reverse: {\n on: 'mcpTokens',\n has: 'one',\n label: 'mcpRefreshToken',\n onDelete: 'cascade',\n },\n },\n mcpTokensClient: {\n forward: {\n on: 'mcpTokens',\n has: 'one',\n label: 'client',\n required: true,\n onDelete: 'cascade',\n },\n reverse: {\n on: 'clients',\n has: 'many',\n label: 'mcpTokens',\n },\n },\n mcpTokensInstantToken: {\n forward: {\n on: 'mcpTokens',\n has: 'one',\n label: 'instantToken',\n required: true,\n onDelete: 'cascade',\n },\n reverse: {\n on: 'instantTokens',\n has: 'many',\n label: 'mcpTokens',\n },\n },\n redirectsClient: {\n forward: {\n on: 'redirects',\n has: 'one',\n label: 'client',\n required: true,\n onDelete: 'cascade',\n },\n reverse: {\n on: 'clients',\n has: 'many',\n label: 'redirects',\n },\n },\n },\n rooms: {},\n});\n\n// This helps TypeScript display nicer intellisense\ntype _AppSchema = typeof _schema;\ninterface AppSchema extends _AppSchema {}\nconst schema: AppSchema = _schema;\n\nexport type { AppSchema };\nexport default schema;\n"]}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.html.d.ts","sourceRoot":"","sources":["../src/index.html.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,IAAI,GAAI,cAAc,MAAM,KAAG,MAgHpC,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
const html = (serverOrigin) => {
|
|
2
|
+
const dev = !serverOrigin.startsWith('https');
|
|
3
|
+
const mcpUrl = `${serverOrigin}/mcp`;
|
|
4
|
+
const cursorConfig = Buffer.from(JSON.stringify({ url: mcpUrl }), 'utf-8').toString('base64');
|
|
5
|
+
const cursorUrl = `https://cursor.com/en/install-mcp?name=InstantDB${dev ? '%20Dev' : ''}&config=${cursorConfig}`;
|
|
6
|
+
return /* HTML */ `<!doctype html>
|
|
7
|
+
<html lang="en">
|
|
8
|
+
<head>
|
|
9
|
+
<meta charset="UTF-8" />
|
|
10
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
11
|
+
<title>InstantDB Remote MCP Server</title>
|
|
12
|
+
<style>
|
|
13
|
+
body {
|
|
14
|
+
font-family: sans-serif;
|
|
15
|
+
display: flex;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
align-items: center;
|
|
18
|
+
margin: 64px;
|
|
19
|
+
color: #1c1e21;
|
|
20
|
+
}
|
|
21
|
+
.container {
|
|
22
|
+
text-align: center;
|
|
23
|
+
padding: 2rem;
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
align-items: center;
|
|
27
|
+
}
|
|
28
|
+
.copy-container {
|
|
29
|
+
display: flex;
|
|
30
|
+
margin: 1rem;
|
|
31
|
+
width: 384px;
|
|
32
|
+
}
|
|
33
|
+
#mcpUrl {
|
|
34
|
+
flex-grow: 1; /* Allows input to fill available space */
|
|
35
|
+
padding: 0.5rem;
|
|
36
|
+
font-size: 1rem;
|
|
37
|
+
border: 1px solid #ccc;
|
|
38
|
+
border-right: none;
|
|
39
|
+
border-radius: 4px 0 0 4px;
|
|
40
|
+
background-color: #f9f9f9;
|
|
41
|
+
}
|
|
42
|
+
#copyButton {
|
|
43
|
+
padding: 0.5rem 1rem;
|
|
44
|
+
border: 1px solid #007bff;
|
|
45
|
+
background-color: #007bff;
|
|
46
|
+
color: white;
|
|
47
|
+
cursor: pointer;
|
|
48
|
+
border-radius: 0 4px 4px 0;
|
|
49
|
+
font-size: 1rem;
|
|
50
|
+
}
|
|
51
|
+
</style>
|
|
52
|
+
</head>
|
|
53
|
+
<body>
|
|
54
|
+
<div class="container">
|
|
55
|
+
<h1>Welcome to InstantDB's remote MCP Server!</h1>
|
|
56
|
+
|
|
57
|
+
<p>
|
|
58
|
+
<a href="${cursorUrl}">
|
|
59
|
+
<img
|
|
60
|
+
src="https://cursor.com/deeplink/mcp-install-dark.svg"
|
|
61
|
+
alt="Add InstantDB's MCP server to Cursor"
|
|
62
|
+
height="32"
|
|
63
|
+
/>
|
|
64
|
+
</a>
|
|
65
|
+
</p>
|
|
66
|
+
|
|
67
|
+
<div class="copy-container">
|
|
68
|
+
<input type="text" value="${mcpUrl}" id="mcpUrl" readonly />
|
|
69
|
+
<button id="copyButton">Copy</button>
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
<p>
|
|
73
|
+
<a href="https://www.interfacedb.com/docs/using-llms"
|
|
74
|
+
>Learn more in the docs.</a
|
|
75
|
+
>
|
|
76
|
+
</p>
|
|
77
|
+
|
|
78
|
+
<p>
|
|
79
|
+
<a
|
|
80
|
+
href="https://github.com/InterfaceLDN/InterfaceDB/tree/main/client/packages/mcp"
|
|
81
|
+
>View the code on GitHub.</a
|
|
82
|
+
>
|
|
83
|
+
</p>
|
|
84
|
+
</div>
|
|
85
|
+
|
|
86
|
+
<script>
|
|
87
|
+
const copyButton = document.getElementById('copyButton');
|
|
88
|
+
const mcpUrlInput = document.getElementById('mcpUrl');
|
|
89
|
+
|
|
90
|
+
copyButton.addEventListener('click', () => {
|
|
91
|
+
// Use the modern Navigator Clipboard API
|
|
92
|
+
navigator.clipboard
|
|
93
|
+
.writeText(mcpUrlInput.value)
|
|
94
|
+
.then(() => {
|
|
95
|
+
// Provide visual feedback to the user
|
|
96
|
+
copyButton.textContent = 'Copied!';
|
|
97
|
+
// Reset the button text after 2 seconds
|
|
98
|
+
setTimeout(() => {
|
|
99
|
+
copyButton.textContent = 'Copy';
|
|
100
|
+
}, 2000);
|
|
101
|
+
})
|
|
102
|
+
.catch((err) => {
|
|
103
|
+
console.error('Failed to copy text: ', err);
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
</script>
|
|
107
|
+
</body>
|
|
108
|
+
</html>`;
|
|
109
|
+
};
|
|
110
|
+
export default html;
|
|
111
|
+
//# sourceMappingURL=index.html.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.html.js","sourceRoot":"","sources":["../src/index.html.ts"],"names":[],"mappings":"AAAA,MAAM,IAAI,GAAG,CAAC,YAAoB,EAAU,EAAE;IAC5C,MAAM,GAAG,GAAG,CAAC,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IAC9C,MAAM,MAAM,GAAG,GAAG,YAAY,MAAM,CAAC;IACrC,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAC9B,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,EAC/B,OAAO,CACR,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAErB,MAAM,SAAS,GAAG,mDAAmD,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,WAAW,YAAY,EAAE,CAAC;IAClH,OAAO,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAoDG,SAAS;;;;;;;;;;wCAUQ,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAwClC,CAAC;AACb,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["const html = (serverOrigin: string): string => {\n const dev = !serverOrigin.startsWith('https');\n const mcpUrl = `${serverOrigin}/mcp`;\n const cursorConfig = Buffer.from(\n JSON.stringify({ url: mcpUrl }),\n 'utf-8',\n ).toString('base64');\n\n const cursorUrl = `https://cursor.com/en/install-mcp?name=InstantDB${dev ? '%20Dev' : ''}&config=${cursorConfig}`;\n return /* HTML */ `<!doctype html>\n <html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <title>InstantDB Remote MCP Server</title>\n <style>\n body {\n font-family: sans-serif;\n display: flex;\n justify-content: center;\n align-items: center;\n margin: 64px;\n color: #1c1e21;\n }\n .container {\n text-align: center;\n padding: 2rem;\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n .copy-container {\n display: flex;\n margin: 1rem;\n width: 384px;\n }\n #mcpUrl {\n flex-grow: 1; /* Allows input to fill available space */\n padding: 0.5rem;\n font-size: 1rem;\n border: 1px solid #ccc;\n border-right: none;\n border-radius: 4px 0 0 4px;\n background-color: #f9f9f9;\n }\n #copyButton {\n padding: 0.5rem 1rem;\n border: 1px solid #007bff;\n background-color: #007bff;\n color: white;\n cursor: pointer;\n border-radius: 0 4px 4px 0;\n font-size: 1rem;\n }\n </style>\n </head>\n <body>\n <div class=\"container\">\n <h1>Welcome to InstantDB's remote MCP Server!</h1>\n\n <p>\n <a href=\"${cursorUrl}\">\n <img\n src=\"https://cursor.com/deeplink/mcp-install-dark.svg\"\n alt=\"Add InstantDB's MCP server to Cursor\"\n height=\"32\"\n />\n </a>\n </p>\n\n <div class=\"copy-container\">\n <input type=\"text\" value=\"${mcpUrl}\" id=\"mcpUrl\" readonly />\n <button id=\"copyButton\">Copy</button>\n </div>\n\n <p>\n <a href=\"https://www.interfacedb.com/docs/using-llms\"\n >Learn more in the docs.</a\n >\n </p>\n\n <p>\n <a\n href=\"https://github.com/InterfaceLDN/InterfaceDB/tree/main/client/packages/mcp\"\n >View the code on GitHub.</a\n >\n </p>\n </div>\n\n <script>\n const copyButton = document.getElementById('copyButton');\n const mcpUrlInput = document.getElementById('mcpUrl');\n\n copyButton.addEventListener('click', () => {\n // Use the modern Navigator Clipboard API\n navigator.clipboard\n .writeText(mcpUrlInput.value)\n .then(() => {\n // Provide visual feedback to the user\n copyButton.textContent = 'Copied!';\n // Reset the button text after 2 seconds\n setTimeout(() => {\n copyButton.textContent = 'Copy';\n }, 2000);\n })\n .catch((err) => {\n console.error('Failed to copy text: ', err);\n });\n });\n </script>\n </body>\n </html>`;\n};\n\nexport default html;\n"]}
|