Skip to main content
Glama

MCP4All

by Melfelf

MCP4All

Projektbeschreibung

Dieses Projekt demonstriert einen MCP-Server (Model Context Protocol) in Node.js. Ziel ist es, GitHub-Projekte automatisiert als Blog-Posts zu dokumentieren.

Installation

  1. Node.js installieren (falls nicht vorhanden)

  2. Abhängigkeiten installieren:

    npm install

Beispielcode

Der MCP-Server ist in server.js implementiert:

const express = require('express'); const axios = require('axios'); const fs = require('fs'); const path = require('path'); const app = express(); app.use(express.json()); app.post('/mcp', async (req, res) => { const { repo, token, blog_path = './blog_content' } = req.body; if (!repo || !token) { return res.status(400).json({ error: 'repo und token sind erforderlich.' }); } try { const url = `https://api.github.com/repos/${repo}/readme`; const response = await axios.get(url, { headers: { Authorization: `token ${token}`, 'User-Agent': 'MCP-Server-Node' } }); const content = Buffer.from(response.data.content, 'base64').toString('utf-8'); fs.mkdirSync(blog_path, { recursive: true }); const filename = path.join(blog_path, `${repo.replace('/', '_')}.md`); fs.writeFileSync(filename, content, 'utf-8'); res.json({ success: true, file: filename }); } catch (err) { res.status(500).json({ error: err.message }); } }); app.get('/', (req, res) => { res.send('MCP4All Node.js Server läuft!'); }); const PORT = process.env.PORT || 5000; app.listen(PORT, () => { console.log(`Server läuft auf Port ${PORT}`); });

Nutzung

Starte den Server:

npm start

Sende eine Anfrage (z. B. mit curl):

curl -X POST http://localhost:5000/mcp \ -H "Content-Type: application/json" \ -d '{"repo":"username/repo","token":"<dein_github_token>"}'

Antwort:

{"success": true, "file": "blog_content/username_repo.md"}

Lizenz

Siehe LICENSE.

Sende eine Anfrage (z. B. mit curl):

curl -X POST http://localhost:5000/mcp -H "Content-Type: application/json" -d '{"input": "Was ist MCP?"}'

Antwort:

{"response": "Du hast gefragt: Was ist MCP?. MCP antwortet: Hallo Welt!"}

Lizenz

Siehe LICENSE. Test

-
security - not tested
A
license - permissive license
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Enables automatic documentation of GitHub projects as blog posts by fetching repository README files through the GitHub API. Provides a simple HTTP server that downloads and saves GitHub project documentation to local markdown files for blog content generation.

  1. Projektbeschreibung
    1. Installation
      1. Beispielcode
        1. Nutzung
          1. Lizenz
            1. Lizenz

              MCP directory API

              We provide all the information about MCP servers via our MCP API.

              curl -X GET 'https://glama.ai/api/mcp/v1/servers/Melfelf/MCP4All'

              If you have feedback or need assistance with the MCP directory API, please join our Discord server