loading…
Search for a command to run...
loading…
An MCP server for managing MDX blog posts and project data with built-in Git integration for automated commits and pushes. It enables AI assistants to perform f
An MCP server for managing MDX blog posts and project data with built-in Git integration for automated commits and pushes. It enables AI assistants to perform full CRUD operations on portfolio content through a standardized protocol or REST API.
An MCP (Model Context Protocol) server that enables AI assistants like Claude to manage blog posts and projects for a personal portfolio site. Supports creating, reading, updating, and deleting MDX blog posts and project entries, with Git integration for committing and pushing changes.
This server connects to a separate portfolio repository (e.g., suthar-portfolio) and provides tools for content management. It can run in three modes:
projectsData.js filenpm install
Copy the example config and update it with the path to your portfolio repository:
cp portfolio-mcp.config.json.example portfolio-mcp.config.json
Edit portfolio-mcp.config.json:
{
"portfolioPath": "/path/to/your/portfolio-repo",
"postsDir": "data/posts",
"projectsFile": "data/projectsData.js",
"git": {
"remote": "origin",
"branch": "main",
"requireConfirmation": true
},
"api": {
"port": 3333,
"host": "localhost"
}
}
Alternatively, set environment variables (takes priority over the config file):
PORTFOLIO_PATH=/path/to/your/portfolio-repo
POSTS_DIR=data/posts
PROJECTS_FILE=data/projectsData.js
GIT_REMOTE=origin
GIT_BRANCH=main
API_PORT=3000
API_HOST=localhost
API_KEY=your-secret-key
ALLOWED_ORIGIN=https://yourdomain.com
npm run build
npm start
Add to your Claude Desktop claude_desktop_config.json:
{
"mcpServers": {
"portfolio-mcp": {
"command": "node",
"args": ["/path/to/portfolio-mcp/dist/index.js"],
"cwd": "/path/to/portfolio-mcp"
}
}
}
npm run start:api
npm run dev # MCP server
npm run dev:api # REST API server
| Tool | Description |
|---|---|
list_posts |
List all blog posts with frontmatter |
get_post |
Get a post's full content by slug |
create_post |
Create a new MDX blog post |
update_post |
Update an existing post's frontmatter or content |
delete_post |
Delete a post by slug |
list_projects |
List all projects |
create_project |
Add a new project |
update_project |
Update a project by title |
delete_project |
Remove a project by title |
git_status |
Show pending changes in the portfolio repo |
git_commit_push |
Commit and push changes (dry-run first, then confirm) |
All endpoints (except /health) require a Bearer token in the Authorization header when API_KEY is set.
| Method | Path | Description |
|---|---|---|
GET |
/health |
Health check (no auth required) |
GET |
/api/posts |
List all posts |
GET |
/api/posts/:slug |
Get a single post |
POST |
/api/posts |
Create a post |
PUT |
/api/posts/:slug |
Update a post |
DELETE |
/api/posts/:slug |
Delete a post |
GET |
/api/projects |
List all projects |
POST |
/api/projects |
Create a project |
PUT |
/api/projects/:title |
Update a project |
DELETE |
/api/projects/:title |
Delete a project |
GET |
/api/git/status |
Git status |
POST |
/api/git/commit-push |
Commit and push |
MDX files with YAML frontmatter, stored in data/posts/:
---
title: 'Post Title'
date: '2024-06-27'
tags: [tag1, tag2, tag3]
draft: false
summary: 'Short description'
---
MDX body content here...
Optional frontmatter fields: pinned (boolean), pinnedtext (string).
Managed in data/projectsData.js as a JavaScript array:
const projectsData = [
{
title: 'Project Name',
description: 'Description',
imgSrc: '/image.jpg',
href: 'https://example.com',
github: 'https://github.com/...',
tech1: 'React',
tech2: 'TypeScript',
tech3: 'Node.js'
}
];
export default projectsData;
Required fields: title, description, imgSrc, href. Optional: github, tech1, tech2, tech3.
The git_commit_push tool uses a two-step confirmation:
confirmed): Returns a dry-run preview of what would be committedconfirmed: true): Executes the commit and pushThis prevents accidental commits and lets the user review changes first.
The api/portfolio.ts handler is a self-contained Vercel serverless function that uses the GitHub Contents API directly, so it does not require local filesystem access to the portfolio repo.
| Variable | Description |
|---|---|
GITHUB_TOKEN |
GitHub personal access token with repo scope |
GITHUB_OWNER |
GitHub username (default: sohumsuthar) |
GITHUB_REPO |
Repository name (default: suthar-portfolio) |
GITHUB_BRANCH |
Branch to read/write (default: main) |
API_KEY |
Secret key for Bearer token auth |
ALLOWED_ORIGIN |
CORS allowed origin |
To connect Claude Desktop to a Vercel-deployed backend, use the MCP proxy:
{
"mcpServers": {
"portfolio-mcp": {
"command": "node",
"args": ["/path/to/portfolio-mcp/dist/mcp-proxy.js"],
"env": {
"PORTFOLIO_API_URL": "https://your-deployment.vercel.app",
"PORTFOLIO_API_KEY": "your-api-key"
}
}
}
}
MIT
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"portfolio-mcp": {
"command": "npx",
"args": []
}
}
}PRs, issues, code search, CI status
Database, auth and storage
Reference / test server with prompts, resources, and tools.
Secure file operations with configurable access controls.