Skip to content

Commit aa69e43

Browse files
committed
more changes
1 parent f840ca9 commit aa69e43

File tree

3 files changed

+96
-20
lines changed

3 files changed

+96
-20
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"server": {
3+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-29/server.schema.json",
4+
"name": "com.figma.mcp/mcp",
5+
"description": "The Figma MCP server brings Figma design context directly into your AI workflow.",
6+
"title": "Figma MCP Server",
7+
"repository": {
8+
"url": "https://github.com/figma/mcp-server-guide",
9+
"source": "github"
10+
},
11+
"version": "1.0.3",
12+
"remotes": [
13+
{
14+
"type": "streamable-http",
15+
"url": "https://mcp.figma.com/mcp"
16+
}
17+
]
18+
},
19+
"_meta": {
20+
"io.modelcontextprotocol.registry/official": {
21+
"status": "active",
22+
"publishedAt": "2025-10-16T17:40:56.949472Z",
23+
"updatedAt": "2025-10-16T17:40:56.949472Z",
24+
"isLatest": true
25+
}
26+
}
27+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"server": {
3+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-29/server.schema.json",
4+
"name": "com.figma.mcp/mcp",
5+
"description": "The Figma MCP server brings Figma design context directly into your AI workflow.",
6+
"title": "Figma MCP Server",
7+
"repository": {
8+
"url": "https://github.com/figma/mcp-server-guide",
9+
"source": "github"
10+
},
11+
"version": "1.0.3",
12+
"remotes": [
13+
{
14+
"type": "streamable-http",
15+
"url": "https://mcp.figma.com/mcp"
16+
}
17+
]
18+
},
19+
"_meta": {
20+
"io.modelcontextprotocol.registry/official": {
21+
"status": "active",
22+
"publishedAt": "2025-10-16T17:40:56.949472Z",
23+
"updatedAt": "2025-10-16T17:40:56.949472Z",
24+
"isLatest": true
25+
}
26+
}
27+
}

scripts/build-registry.mjs

Lines changed: 42 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
#!/usr/bin/env node
2-
// Fetches the official Figma MCP server from the registry and writes:
3-
// public/v0.1/servers — Copilot org registry endpoint (base URL: https://vydia.github.io/mini-mcp-registry)
4-
// public/allowed-servers — legacy / direct access
2+
// Generates static registry files for GitHub Pages.
3+
// Enter the full URL in org settings: https://vydia.github.io/mini-mcp-registry/v0.1/servers.json
4+
//
5+
// Files generated:
6+
// public/v0.1/servers.json → list endpoint (use this URL in org settings)
7+
// public/v0.1/<name>/versions/latest.json → individual server lookup
8+
// public/allowed-servers.json → UI / direct access
59

610
import { writeFileSync, mkdirSync } from 'fs';
711
import { join, dirname } from 'path';
@@ -10,28 +14,46 @@ import { fileURLToPath } from 'url';
1014
const __dirname = dirname(fileURLToPath(import.meta.url));
1115
const OUT_DIR = join(__dirname, '..', 'public');
1216

13-
async function fetchFigmaOfficial() {
14-
const url = 'https://registry.modelcontextprotocol.io/v0.1/servers/com.figma.mcp%2Fmcp/versions/latest';
17+
// Add server names here to include them
18+
const ALLOWED_SERVERS = [
19+
'com.figma.mcp/mcp',
20+
];
21+
22+
async function fetchServer(name) {
23+
const encoded = encodeURIComponent(name);
24+
const url = `https://registry.modelcontextprotocol.io/v0.1/servers/${encoded}/versions/latest`;
1525
const res = await fetch(url);
16-
if (!res.ok) throw new Error(`Registry API error: ${res.status}`);
26+
if (!res.ok) throw new Error(`Failed to fetch ${name}: ${res.status}`);
1727
return res.json();
1828
}
1929

20-
mkdirSync(join(OUT_DIR, 'v0.1'), { recursive: true });
30+
function write(filePath, data) {
31+
mkdirSync(dirname(filePath), { recursive: true });
32+
writeFileSync(filePath, typeof data === 'string' ? data : JSON.stringify(data, null, 2));
33+
}
34+
35+
console.log('Fetching allowed servers...');
36+
const entries = [];
2137

22-
console.log('Fetching official Figma MCP server...');
23-
const entry = await fetchFigmaOfficial();
38+
for (const name of ALLOWED_SERVERS) {
39+
process.stdout.write(` ${name}...`);
40+
const entry = await fetchServer(name);
41+
entries.push(entry);
2442

25-
const payload = {
26-
servers: [entry],
27-
metadata: {
28-
count: 1,
29-
nextCursor: null,
30-
},
43+
// Individual server lookup: /v0.1/<name>/versions/latest.json
44+
const serverDir = join(OUT_DIR, 'v0.1', ...name.split('/'));
45+
write(join(serverDir, 'versions', 'latest.json'), entry);
46+
write(join(serverDir, 'versions', `${entry.server.version}.json`), entry);
47+
console.log(` ✓ v${entry.server.version}`);
48+
}
49+
50+
const list = {
51+
servers: entries,
52+
metadata: { count: entries.length, nextCursor: null },
3153
};
3254

33-
const json = JSON.stringify(payload, null, 2);
34-
writeFileSync(join(OUT_DIR, 'v0.1', 'servers.json'), json);
35-
console.log('✓ public/v0.1/servers.json written');
36-
writeFileSync(join(OUT_DIR, 'allowed-servers.json'), json);
37-
console.log('✓ public/allowed-servers.json written');
55+
write(join(OUT_DIR, 'v0.1', 'servers.json'), list);
56+
write(join(OUT_DIR, 'allowed-servers.json'), list);
57+
58+
console.log(`\n✓ public/v0.1/servers.json${entries.length} server(s)`);
59+
console.log('✓ public/allowed-servers.json');

0 commit comments

Comments
 (0)