mirror of
https://github.com/waynesutton/markdown-site.git
synced 2026-01-12 04:09:14 +00:00
feat: Add MCP server fork setup instructions and update documentation
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
---
|
||||
title: "How to Use the MCP Server"
|
||||
description: "Guide to using the HTTP-based Model Context Protocol server at www.markdown.fast/mcp with Cursor and other AI tools"
|
||||
title: "How to Use the MCP Server with MarkDown.fast"
|
||||
description: "Guide to using the HTTP-based Model Context Protocol(MCP) server at www.markdown.fast/mcp with Cursor and other AI tools"
|
||||
date: "2025-12-28"
|
||||
slug: "how-to-use-mcp-server"
|
||||
image: /images/mcp-blog.png
|
||||
published: true
|
||||
blogFeatured: true
|
||||
tags: ["mcp", "cursor", "ai", "tutorial", "netlify"]
|
||||
---
|
||||
|
||||
@@ -34,15 +36,15 @@ No authentication is required for public access.
|
||||
|
||||
The server exposes seven tools:
|
||||
|
||||
| Tool | Description |
|
||||
|------|-------------|
|
||||
| `list_posts` | Get all published blog posts with metadata |
|
||||
| `get_post` | Get a single post by slug with full content |
|
||||
| `list_pages` | Get all published pages |
|
||||
| `get_page` | Get a single page by slug with full content |
|
||||
| `get_homepage` | Get homepage data with featured and recent posts |
|
||||
| `search_content` | Full text search across posts and pages |
|
||||
| `export_all` | Batch export all content |
|
||||
| Tool | Description |
|
||||
| ---------------- | ------------------------------------------------ |
|
||||
| `list_posts` | Get all published blog posts with metadata |
|
||||
| `get_post` | Get a single post by slug with full content |
|
||||
| `list_pages` | Get all published pages |
|
||||
| `get_page` | Get a single page by slug with full content |
|
||||
| `get_homepage` | Get homepage data with featured and recent posts |
|
||||
| `search_content` | Full text search across posts and pages |
|
||||
| `export_all` | Batch export all content |
|
||||
|
||||
## Client configuration
|
||||
|
||||
@@ -209,12 +211,82 @@ The MCP server is designed with security in mind:
|
||||
|
||||
## For your own fork
|
||||
|
||||
When you fork this site, the MCP server automatically connects to your Convex deployment. Just ensure:
|
||||
When you fork this site, the MCP server is already included and will automatically connect to your Convex deployment. Here's how to set it up:
|
||||
|
||||
1. `VITE_CONVEX_URL` is set in your Netlify environment variables
|
||||
2. (Optional) Set `MCP_API_KEY` for authenticated access
|
||||
### Prerequisites
|
||||
|
||||
The server reads from your Convex database, so any content you sync will be available via MCP.
|
||||
1. Fork the repository to your GitHub account
|
||||
2. Set up Convex backend (see [Setup Guide](/setup-guide))
|
||||
3. Deploy to Netlify (see [Setup Guide](/setup-guide))
|
||||
|
||||
### Setup Steps
|
||||
|
||||
1. **Set Convex URL in Netlify**
|
||||
|
||||
The MCP server needs your Convex deployment URL to fetch content. Add this environment variable in your Netlify dashboard:
|
||||
- Go to Site Settings > Environment Variables
|
||||
- Add `VITE_CONVEX_URL` with your production Convex URL (e.g., `https://your-deployment.convex.cloud`)
|
||||
|
||||
2. **Deploy your site**
|
||||
|
||||
The MCP server is already configured in `netlify/edge-functions/mcp.ts` and `netlify.toml`. When you deploy to Netlify, the server will be available at:
|
||||
|
||||
```
|
||||
https://your-site.netlify.app/mcp
|
||||
```
|
||||
|
||||
Or your custom domain:
|
||||
|
||||
```
|
||||
https://yourdomain.com/mcp
|
||||
```
|
||||
|
||||
3. **Optional: Set API key for higher rate limits**
|
||||
|
||||
If you want authenticated access with higher rate limits:
|
||||
- Add `MCP_API_KEY` to your Netlify environment variables
|
||||
- Use this key in your client configuration (see "With API key" section above)
|
||||
|
||||
### How it works
|
||||
|
||||
The MCP server reads from your Convex database using the same queries as your public website. Any content you sync with `npm run sync` or `npm run sync:prod` will be immediately available via the MCP server.
|
||||
|
||||
### Testing your fork's MCP server
|
||||
|
||||
After deploying, test your MCP server:
|
||||
|
||||
```bash
|
||||
# Replace with your site URL
|
||||
curl -X POST https://your-site.netlify.app/mcp \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
|
||||
```
|
||||
|
||||
You should receive a response listing all seven available tools.
|
||||
|
||||
### Client configuration for your fork
|
||||
|
||||
Update your Cursor or Claude Desktop configuration to use your fork's endpoint:
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"my-blog": {
|
||||
"url": "https://your-site.netlify.app/mcp"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Files included
|
||||
|
||||
The MCP server implementation is included in your fork:
|
||||
|
||||
- `netlify/edge-functions/mcp.ts` - MCP server implementation
|
||||
- `netlify.toml` - Edge function route configuration
|
||||
- `package.json` - Includes `@modelcontextprotocol/sdk` dependency
|
||||
|
||||
No additional code changes needed. Just set the environment variable and deploy.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
@@ -233,6 +305,7 @@ Verify the tool name matches one of the seven available tools exactly.
|
||||
### Invalid JSON-RPC
|
||||
|
||||
Ensure your request includes:
|
||||
|
||||
- `"jsonrpc": "2.0"`
|
||||
- A numeric or string `id`
|
||||
- A `method` string
|
||||
|
||||
Reference in New Issue
Block a user