### Quick Start
Source: https://github.com/scalvert/docusaurus-plugin-mcp-server/blob/main/examples/basic-docs/README.md
Install dependencies, build the site, and start the local MCP server.
```bash
# Install dependencies
npm install
# Build the site (generates MCP artifacts)
npm run build
# Start the local MCP server
npm run mcp:serve
```
--------------------------------
### Getting Started
Source: https://github.com/scalvert/docusaurus-plugin-mcp-server/blob/main/CONTRIBUTING.md
Cloning the repository, installing dependencies, and building the project.
```bash
git clone https://github.com/scalvert/docusaurus-plugin-mcp-server.git
cd docusaurus-plugin-mcp-server
npm install
npm run build
```
--------------------------------
### Verifying Installation
Source: https://github.com/scalvert/docusaurus-plugin-mcp-server/blob/main/examples/basic-docs/docs/getting-started/installation.md
Verify installation by importing the SDK and logging its version.
```javascript
import { Client } from '@example/sdk';
const client = new Client({
apiKey: 'your-api-key',
});
console.log('SDK version:', client.version);
```
--------------------------------
### Install using npm
Source: https://github.com/scalvert/docusaurus-plugin-mcp-server/blob/main/examples/basic-docs/docs/getting-started/installation.md
Install the package using npm.
```bash
npm install @example/sdk
```
--------------------------------
### Install using yarn
Source: https://github.com/scalvert/docusaurus-plugin-mcp-server/blob/main/examples/basic-docs/docs/getting-started/installation.md
Install the package using yarn.
```bash
yarn add @example/sdk
```
--------------------------------
### Configuration
Source: https://github.com/scalvert/docusaurus-plugin-mcp-server/blob/main/examples/basic-docs/README.md
Example configuration for the docusaurus-plugin-mcp-server plugin in docusaurus.config.js.
```javascript
plugins: [
[
'docusaurus-plugin-mcp-server',
{
server: {
name: 'example-docs',
version: '1.0.0',
},
},
],
],
```
--------------------------------
### Quick Example
Source: https://github.com/scalvert/docusaurus-plugin-mcp-server/blob/main/examples/basic-docs/docs/intro.md
Example queries that AI agents can use to interact with documentation exposed by docusaurus-plugin-mcp-server.
```text
Search for "authentication" in the docs
Get the page at /docs/api/authentication
Get the "oauth-configuration" section from the authentication page
```
--------------------------------
### Test the Server - Search Documentation
Source: https://github.com/scalvert/docusaurus-plugin-mcp-server/blob/main/examples/basic-docs/README.md
Search documentation using the MCP server.
```bash
curl -X POST http://localhost:3456 \
-H "Content-Type: application/json" \
-d '{
"jsonrpc":"2.0",
"id":2,
"method":"tools/call",
"params":{
"name":"docs_search",
"arguments":{"query":"authentication"}
}
}'
```
--------------------------------
### Create User - Example Request
Source: https://github.com/scalvert/docusaurus-plugin-mcp-server/blob/main/examples/basic-docs/docs/api/endpoints.md
Example request for creating a new user.
```bash
curl -X POST https://api.example.com/v1/users \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"email": "jane@example.com", "name": "Jane Smith"}'
```
--------------------------------
### Test the Server - List Available Tools
Source: https://github.com/scalvert/docusaurus-plugin-mcp-server/blob/main/examples/basic-docs/README.md
List available tools using the MCP server.
```bash
curl -X POST http://localhost:3456 \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
```
--------------------------------
### Install docusaurus-plugin-mcp-server
Source: https://github.com/scalvert/docusaurus-plugin-mcp-server/blob/main/README.md
Install the plugin using npm.
```bash
npm install docusaurus-plugin-mcp-server
```
--------------------------------
### Install Button Component
Source: https://github.com/scalvert/docusaurus-plugin-mcp-server/blob/main/README.md
Example of using the McpInstallButton component in a Docusaurus site.
```tsx
import { McpInstallButton } from 'docusaurus-plugin-mcp-server/theme';
function NavbarItems() {
return ;
}
```
--------------------------------
### Configuring Custom Providers Example
Source: https://github.com/scalvert/docusaurus-plugin-mcp-server/blob/main/README.md
Example docusaurus.config.js configuration for custom providers.
```javascript
// docusaurus.config.js
module.exports = {
plugins: [
[
'docusaurus-plugin-mcp-server',
{
// Run both the built-in FlexSearch indexer and a custom one
indexers: ['flexsearch', './my-algolia-indexer.js'],
// Use a custom search provider at runtime
search: '@myorg/glean-search',
},
],
],
};
```
--------------------------------
### Connect AI Tools - Claude Code
Source: https://github.com/scalvert/docusaurus-plugin-mcp-server/blob/main/examples/basic-docs/README.md
Add the example-docs MCP server for Claude.
```bash
claude mcp add --transport http example-docs http://localhost:3456
```
--------------------------------
### Connect AI Tools - Cursor / VS Code
Source: https://github.com/scalvert/docusaurus-plugin-mcp-server/blob/main/examples/basic-docs/README.md
Add the example-docs MCP server configuration to your MCP settings.
```json
{
"mcpServers": {
"example-docs": {
"url": "http://localhost:3456"
}
}
}
```
--------------------------------
### Environment Variables
Source: https://github.com/scalvert/docusaurus-plugin-mcp-server/blob/main/examples/basic-docs/docs/getting-started/installation.md
Store your API key in an environment variable and access it in your code.
```bash
export EXAMPLE_API_KEY=your-api-key
```
```javascript
const client = new Client({
apiKey: process.env.EXAMPLE_API_KEY,
});
```
--------------------------------
### MCP Build Verification Example Output
Source: https://github.com/scalvert/docusaurus-plugin-mcp-server/blob/main/README.md
Example output demonstrating a successful verification of the MCP build, showing checks for build output and MCP server initialization.
```bash
🔍 MCP Build Verification
==================================================
Build directory: /path/to/your/project/build
📁 Checking build output...
✓ Found 42 documents
✓ All required files present
✓ File structure valid
🚀 Testing MCP server...
✓ Server initialized with 42 documents
✅ All checks passed!
```
--------------------------------
### Get User - Example Request
Source: https://github.com/scalvert/docusaurus-plugin-mcp-server/blob/main/examples/basic-docs/docs/api/endpoints.md
Retrieve a single user by ID.
```bash
curl https://api.example.com/v1/users/user_123 \
-H "Authorization: Bearer YOUR_API_KEY"
```
--------------------------------
### Install Project Dependencies
Source: https://github.com/scalvert/docusaurus-plugin-mcp-server/blob/main/RELEASE.md
Ensures that all project dependencies are installed before proceeding with the release.
```sh
npm install
```
--------------------------------
### Glean Search Provider Example
Source: https://github.com/scalvert/docusaurus-plugin-mcp-server/blob/main/README.md
Example implementation of a custom SearchProvider for Glean.
```typescript
import type {
SearchProvider,
ProviderContext,
SearchOptions,
SearchResult,
} from 'docusaurus-plugin-mcp-server';
export default class GleanSearchProvider implements SearchProvider {
readonly name = 'glean';
private apiEndpoint = process.env.GLEAN_API_ENDPOINT!;
private apiToken = process.env.GLEAN_API_TOKEN!;
async initialize(context: ProviderContext): Promise {
if (!this.apiEndpoint || !this.apiToken) {
throw new Error('GLEAN_API_ENDPOINT and GLEAN_API_TOKEN required');
}
}
isReady(): boolean {
return !!this.apiEndpoint && !!this.apiToken;
}
async search(query: string, options?: SearchOptions): Promise {
// Call Glean Search API and transform results
return [];
}
}
```
--------------------------------
### Test the Server - Health Check
Source: https://github.com/scalvert/docusaurus-plugin-mcp-server/blob/main/examples/basic-docs/README.md
Perform a health check on the MCP server.
```bash
curl http://localhost:3456
```
--------------------------------
### List Users - Example Response
Source: https://github.com/scalvert/docusaurus-plugin-mcp-server/blob/main/examples/basic-docs/docs/api/endpoints.md
Example response for listing users.
```json
{
"data": [
{
"id": "user_123",
"email": "john@example.com",
"name": "John Doe",
"status": "active",
"createdAt": "2024-01-15T10:30:00Z"
}
],
"pagination": {
"page": 1,
"limit": 10,
"total": 42
}
}
```
--------------------------------
### List Users - Example Request
Source: https://github.com/scalvert/docusaurus-plugin-mcp-server/blob/main/examples/basic-docs/docs/api/endpoints.md
Retrieve a paginated list of users.
```bash
curl https://api.example.com/v1/users?limit=10 \
-H "Authorization: Bearer YOUR_API_KEY"
```
--------------------------------
### cURL Example
Source: https://github.com/scalvert/docusaurus-plugin-mcp-server/blob/main/examples/basic-docs/docs/api/authentication.md
Include your API key in the `Authorization` header when making requests.
```bash
curl https://api.example.com/v1/users \
-H "Authorization: Bearer YOUR_API_KEY"
```
--------------------------------
### Algolia Indexer Example
Source: https://github.com/scalvert/docusaurus-plugin-mcp-server/blob/main/README.md
Example implementation of a custom ContentIndexer for Algolia.
```typescript
import type { ContentIndexer, ProviderContext, ProcessedDoc } from 'docusaurus-plugin-mcp-server';
export default class AlgoliaIndexer implements ContentIndexer {
readonly name = 'algolia';
shouldRun(): boolean {
return process.env.ALGOLIA_SYNC === 'true';
}
async initialize(context: ProviderContext): Promise {
console.log(`[Algolia] Initializing for ${context.baseUrl}`);
}
async indexDocuments(docs: ProcessedDoc[]): Promise {
// Push docs to Algolia
}
async finalize(): Promise