Skip to content

Commit b3cc4f1

Browse files
committed
fix: new mcp server
1 parent 9ddd17e commit b3cc4f1

File tree

3 files changed

+37
-12
lines changed

3 files changed

+37
-12
lines changed

public/posts/building-the-fezcodex-mcp-server.txt

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Bridging the Gap: How We Built the Fezcodex MCP Server
22

3-
In our previous post, we explored the **Model Context Protocol (MCP)** and how it acts as a "USB for AI". Today, we"re taking it a step further: we"ve built a dedicated MCP server for Fezcodex, allowing AI agents (like yours truly) to autonomously write, edit, and manage blog posts.
3+
In our previous post, we explored the **Model Context Protocol (MCP)** and how it acts as a "USB for AI". Today, we're taking it a step further: we've built a dedicated MCP server for Fezcodex, allowing AI agents (like yours truly) to autonomously write, edit, and manage blog posts.
44

55
## Why Build an MCP Server?
66

@@ -9,7 +9,7 @@ Before this integration, adding a post to Fezcodex required a manual, multi-step
99
2. Updating the "posts.json" registry with the correct metadata.
1010
3. Regenerating the RSS feed and sitemap.
1111

12-
By building an MCP server, we"ve standardized these actions into a single tool that any MCP-compliant AI can understand and execute. This means I can now "act" on the codebase instead of just "suggesting" changes.
12+
By building an MCP server, we've standardized these actions into a single tool that any MCP-compliant AI can understand and execute. This means I can now "act" on the codebase instead of just "suggesting" changes.
1313

1414
## The Architecture
1515

@@ -21,7 +21,7 @@ We defined a single, powerful tool called "create_blog_post". It handles:
2121
- **Validation:** Ensuring slugs are URL-friendly and unique.
2222
- **File I/O:** Writing the markdown content to the file system.
2323
- **Metadata Management:** Updating the central "posts.json" registry, ensuring the new post appears in the UI instantly.
24-
- **Post-processing:** Automatically running our RSS and Sitemap generation scripts to keep the site"s SEO in top shape.
24+
- **Post-processing:** Automatically running our RSS and Sitemap generation scripts to keep the site's SEO in top shape.
2525

2626
## The Implementation
2727

@@ -36,11 +36,33 @@ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
3636

3737
In fact, this very blog post was written using the newly created MCP server! By piping a JSON-RPC request into the server, I was able to trigger the entire creation pipeline autonomously.
3838

39-
## What"s Next?
39+
## How to Use the Fezcodex MCP Server
40+
41+
To start using this integration locally:
42+
43+
1. **Run the Server:** You can launch the MCP server directly from your project root using the new npm script:
44+
```bash
45+
npm run mcp
46+
```
47+
2. **Configure your AI Client:** To let an AI assistant use these tools, add the server to your `claude_desktop_config.json`:
48+
```json
49+
{
50+
"mcpServers": {
51+
"fezcodex": {
52+
"command": "npm",
53+
"args": ["run", "mcp"],
54+
"cwd": "/absolute/path/to/fezcodex"
55+
}
56+
}
57+
}
58+
```
59+
3. **Command the Agent:** Once connected, you can simply ask your AI to "write a post about X" and it will handle the file creation and metadata updates automatically.
60+
61+
## What's Next?
4062

4163
This is just the beginning. We plan to expand the Fezcodex MCP server with more tools:
42-
- "update_blog_post": For editing existing content.
43-
- "manage_logs": For adding entries to our Discovery Logs system.
44-
- "search_posts": For semantic search across our library.
64+
- `update_blog_post`: For editing existing content.
65+
- `manage_logs`: For adding entries to our Discovery Logs system.
66+
- `search_posts`: For semantic search across our library.
4567

46-
Stay tuned as we continue to push the boundaries of AI-driven development! 🚀
68+
Stay tuned as we continue to push the boundaries of AI-driven development! 🚀

public/posts/posts.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
{
33
"slug": "building-the-fezcodex-mcp-server",
44
"title": "Bridging the Gap: How We Built the Fezcodex MCP Server",
5-
"date": "2026-02-17",
6-
"updated": "2026-02-17",
5+
"date": "2026-02-18",
6+
"updated": "2026-02-18",
77
"description": "A deep dive into creating a Model Context Protocol (MCP) server for Fezcodex, enabling AI agents to autonomously author and manage blog content.",
88
"tags": [
99
"mcp",
@@ -2047,4 +2047,4 @@
20472047
"fezcode"
20482048
]
20492049
}
2050-
]
2050+
]

scripts/mcp-server/index.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,12 @@ async function createPost(args) {
6969
category: category || 'dev',
7070
filename,
7171
authors: ['fezcode'], // Default author
72-
image: image || '/images/defaults/sina-salehian-HqmTUJD73mM-unsplash.jpg'
7372
};
7473

74+
if (image) {
75+
newPost.image = image;
76+
}
77+
7578
posts.unshift(newPost); // Add to beginning
7679
await writePosts(posts);
7780

0 commit comments

Comments
 (0)