@modelcontextprotocol/server-wiki-explorer 0.4.1

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/README.md ADDED
@@ -0,0 +1,66 @@
1
+ # Example: Wiki Explorer
2
+
3
+ Visualizes Wikipedia link graphs using a force-directed layout. Explore how Wikipedia pages are connected by expanding nodes to reveal first-degree links.
4
+
5
+ <table>
6
+ <tr>
7
+ <td><a href="https://modelcontextprotocol.github.io/ext-apps/screenshots/wiki-explorer-server/01-zoomed.png"><img src="https://modelcontextprotocol.github.io/ext-apps/screenshots/wiki-explorer-server/01-zoomed.png" alt="Zoomed" width="100%"></a></td>
8
+ <td><a href="https://modelcontextprotocol.github.io/ext-apps/screenshots/wiki-explorer-server/02-pop-up.png"><img src="https://modelcontextprotocol.github.io/ext-apps/screenshots/wiki-explorer-server/02-pop-up.png" alt="Pop-up" width="100%"></a></td>
9
+ <td><a href="https://modelcontextprotocol.github.io/ext-apps/screenshots/wiki-explorer-server/03-expanded-graph.png"><img src="https://modelcontextprotocol.github.io/ext-apps/screenshots/wiki-explorer-server/03-expanded-graph.png" alt="Expanded graph" width="100%"></a></td>
10
+ </tr>
11
+ </table>
12
+
13
+ ## Features
14
+
15
+ - **Force-directed graph visualization**: Interactive graph powered by [`force-graph`](https://github.com/vasturiano/force-graph)
16
+ - **Node expansion**: Click any node to expand and see all pages it links to
17
+ - **Visual state tracking**: Nodes change color based on state (blue = default, green = expanded, red = error)
18
+ - **Direct page access**: Open any Wikipedia page in your browser
19
+
20
+ ## Running
21
+
22
+ 1. Install dependencies:
23
+
24
+ ```bash
25
+ npm install
26
+ ```
27
+
28
+ 2. Build and start the server:
29
+
30
+ ```bash
31
+ npm run start:http # for Streamable HTTP transport
32
+ # OR
33
+ npm run start:stdio # for stdio transport
34
+ ```
35
+
36
+ 3. View using the [`basic-host`](https://github.com/modelcontextprotocol/ext-apps/tree/main/examples/basic-host) example or another MCP Apps-compatible host.
37
+
38
+ ### Tool Input
39
+
40
+ To test the example, call the `get-first-degree-links` tool with a Wikipedia URL:
41
+
42
+ ```json
43
+ {
44
+ "url": "https://en.wikipedia.org/wiki/Graph_theory"
45
+ }
46
+ ```
47
+
48
+ Click nodes in the graph to **Open** (view in browser) or **Expand** (visualize linked pages).
49
+
50
+ ## Architecture
51
+
52
+ ### Server (`server.ts`)
53
+
54
+ MCP server that fetches Wikipedia pages and extracts internal links.
55
+
56
+ Exposes one tool:
57
+
58
+ - `get-first-degree-links` - Returns links to other Wikipedia pages from a given page
59
+
60
+ ### App (`src/mcp-app.ts`)
61
+
62
+ Vanilla TypeScript app using force-graph for visualization that:
63
+
64
+ - Receives tool inputs via the MCP App SDK
65
+ - Renders an interactive force-directed graph
66
+ - Supports node expansion to explore link relationships