Skip to main content
Glama

🍌 Banana – Dein erster MCP-Server

Willkommen! Dieses Projekt ist ein kleiner MCP-Server mit dem Namen Banana. Er stellt einer KI (z. B. GitHub Copilot oder Claude) ein paar nützliche "Werkzeuge" (Tools) zur Verfügung:

  • Zahlen addieren (add)

  • 📝 Textdateien erstellen (create_text_file)

  • 🗒️ Log-Einträge schreiben (log_entry)

Diese Anleitung ist für absolute Anfänger geschrieben. Du musst vorher nichts über Programmierung wissen. Geh einfach Schritt für Schritt vor. 😊


📚 Inhaltsverzeichnis

  1. Was ist MCP überhaupt?

  2. Was du am Ende kannst

  3. Voraussetzungen

  4. Schritt-für-Schritt-Installation

  5. Den Server starten

  6. Den Server mit dem MCP Inspector testen

  7. Den Server in VS Code / Copilot einbinden

  8. Die Tools im Detail

  9. Projektstruktur

  10. Häufige Fehler & Lösungen

  11. Eigene Tools hinzufügen


Related MCP server: MCP Playground Server

🤔 Was ist MCP überhaupt?

MCP steht für Model Context Protocol.

Stell dir eine KI (wie ChatGPT oder Copilot) vor. Von sich aus kann sie nur reden. Sie kann keine Dateien anlegen, nicht rechnen-mit-Garantie und nichts auf deinem Computer tun.

Ein MCP-Server ist wie eine Werkzeugkiste, die du der KI in die Hand gibst. Plötzlich kann die KI z. B. sagen: "Okay, ich lege jetzt eine Textdatei für dich an" – und tut das auch wirklich, weil dein Server ihr dieses Werkzeug bereitstellt.

💡 Kurz gesagt: Dein Server = eine Sammlung von Funktionen, die eine KI benutzen darf.


🎯 Was du am Ende kannst

Nach dieser Anleitung hast du:

  • ✅ Python und uv installiert

  • ✅ Den Banana-Server zum Laufen gebracht

  • ✅ Den Server getestet

  • ✅ Verstanden, wie du eigene Werkzeuge hinzufügst


🧰 Voraussetzungen

Was

Warum

Ein Computer mit Windows, macOS oder Linux

Darauf läuft alles

Internetverbindung

Zum Herunterladen der Programme

Ein bisschen Geduld 😉

Beim ersten Mal dauert es ein paar Minuten

Du brauchst keine Vorkenntnisse. Alles wird unten erklärt.


🪜 Schritt-für-Schritt-Installation

Schritt 1: Python installieren

Dieses Projekt braucht Python Version 3.14 oder neuer.

Prüfen, ob Python schon da ist

Öffne ein Terminal (auf Windows: Suche nach "PowerShell" und öffne es) und tippe:

python --version
  • Erscheint z. B. Python 3.14.0 oder höher → super, weiter zu Schritt 2.

  • Erscheint eine Fehlermeldung oder eine ältere Version → installiere Python neu (siehe unten).

Python herunterladen

  1. Gehe auf die offizielle Seite: https://www.python.org/downloads/

  2. Klicke auf den großen gelben Button "Download Python".

  3. Starte die heruntergeladene Datei.

  4. ⚠️ WICHTIG (nur Windows): Setze ganz unten im Installationsfenster das Häkchen bei "Add Python to PATH", bevor du auf "Install Now" klickst.

  5. Klicke auf "Install Now" und warte, bis es fertig ist.

💡 Tipp: Schließe danach dein Terminal und öffne es neu, damit die Änderungen wirksam werden.


Schritt 2: uv installieren

uv ist ein modernes Werkzeug, das Python-Projekte verwaltet (Pakete installieren, Programme starten usw.). Es ist sehr schnell und macht uns das Leben leicht.

Auf Windows (in PowerShell):

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

Auf macOS oder Linux (im Terminal):

curl -LsSf https://astral.sh/uv/install.sh | sh

Nach der Installation: Terminal schließen und neu öffnen. Dann prüfen, ob es funktioniert:

uv --version

Wenn eine Versionsnummer erscheint (z. B. uv 0.5.0), hat alles geklappt. 🎉


Schritt 3: Projekt öffnen

  1. Öffne Visual Studio Code (kostenlos hier: https://code.visualstudio.com/).

  2. Klicke oben auf Datei → Ordner öffnen…

  3. Wähle den Ordner banana aus (den, in dem auch diese README liegt).

  4. Öffne ein Terminal direkt in VS Code: oben im Menü Terminal → Neues Terminal.

Du solltest jetzt unten im Terminal so etwas sehen wie:

PS C:\Users\deinname\Desktop\MCP_TUTORIAL\banana>

Das bedeutet: Du befindest dich im richtigen Ordner. Perfekt.


Schritt 4: Abhängigkeiten installieren

"Abhängigkeiten" sind zusätzliche Bausteine, die unser Projekt benötigt (hier vor allem das MCP-Paket). uv lädt sie automatisch herunter. Tippe einfach:

uv sync

Das passiert dabei:

  • uv erstellt eine sogenannte virtuelle Umgebung (einen abgeschotteten Bereich nur für dieses Projekt).

  • Es installiert das Paket mcp[cli] und alles, was dazugehört.

Beim ersten Mal dauert das einen Moment. Wenn es fertig ist, bist du startklar. ✅


▶️ Den Server starten

Starte den Server mit diesem Befehl:

uv run server.py

Wenn alles funktioniert, läuft der Server jetzt und wartet auf Anfragen. Zum Beenden drückst du im Terminal Strg + C.

💡 Ein MCP-Server "redet" normalerweise nicht viel von selbst. Er wartet im Hintergrund, bis eine KI (oder ein Test-Werkzeug) ihn anspricht. Keine Sorge, wenn nicht viel passiert – das ist normal.


🔍 Den Server mit dem MCP Inspector testen

Der MCP Inspector ist ein praktisches Test-Werkzeug mit einer Oberfläche im Browser. Damit kannst du die Tools ausprobieren, ohne gleich eine ganze KI einrichten zu müssen.

Starte ihn so:

uv run mcp dev server.py

Es öffnet sich (oder wird dir im Terminal angezeigt) eine Adresse wie http://localhost:5173. Öffne diese im Browser. Dort kannst du:

  1. Links die Tools sehen: add, create_text_file, log_entry.

  2. Ein Tool anklicken, Werte eingeben und auf "Run" klicken.

  3. Das Ergebnis direkt anschauen.

Probiere z. B. das Tool add mit a = 5 und b = 3 aus. 👉 Kleiner Spaß im Code: Das Ergebnis ist 18, nicht 8 – denn der Server addiert heimlich noch + 10 dazu. 🍌


🧩 Den Server in VS Code / Copilot einbinden

Damit GitHub Copilot in VS Code deinen Server benutzen darf, legst du eine Konfigurationsdatei an.

Erstelle eine Datei .vscode/mcp.json mit folgendem Inhalt:

{
  "servers": {
    "banana": {
      "command": "uv",
      "args": ["run", "server.py"],
      "cwd": "${workspaceFolder}"
    }
  }
}

Danach erkennt Copilot den Server Banana und darf seine Tools verwenden.


🛠️ Die Tools im Detail

add(a, b)

Addiert zwei ganze Zahlen – und legt aus Spaß immer noch + 10 obendrauf.

Eingabe

Typ

Bedeutung

a

Zahl

Erste Zahl

b

Zahl

Zweite Zahl

Beispiel: add(2, 3)15


📝 create_text_file(filename, text)

Erstellt eine neue Textdatei im Ordner deine_texte/.

Eingabe

Typ

Bedeutung

filename

Text

Name der Datei (ohne .txt)

text

Text

Inhalt der Datei

Beispiel: create_text_file("notizen", "Hallo Welt") → erzeugt die Datei deine_texte/notizen.txt mit dem Inhalt Hallo Welt.

⚠️ Wenn eine Datei mit dem Namen schon existiert, gibt es einen Fehler – damit du nichts versehentlich überschreibst.


🗒️ log_entry(message)

Schreibt eine Nachricht mit Zeitstempel in die Datei banana.log.

Eingabe

Typ

Bedeutung

message

Text

Die Nachricht, die geloggt wird

Beispiel: log_entry("Server gestartet") → fügt eine Zeile wie [2026-06-12 14:30:00] Server gestartet hinzu.


📁 Projektstruktur

banana/
├── server.py              ← Das Herzstück: hier sind die Tools definiert
├── pyproject.toml         ← Projekt-Infos & Abhängigkeiten
├── README.md              ← Diese Anleitung
├── banana.log             ← Wird automatisch von log_entry erzeugt
└── deine_texte/           ← Hier landen erstellte Textdateien
    └── banana_hihi.txt

🚑 Häufige Fehler & Lösungen

Problem

Mögliche Lösung

python wird nicht erkannt

Python neu installieren und Häkchen bei "Add Python to PATH" setzen. Terminal neu öffnen.

uv wird nicht erkannt

Terminal nach der uv-Installation schließen und neu öffnen.

uv sync schlägt fehl

Internetverbindung prüfen. Sicherstellen, dass du im Ordner banana bist.

Falsche Python-Version

Du brauchst mindestens 3.14. Prüfe mit python --version.

Server reagiert nicht / "hängt"

Das ist normal! Der Server wartet auf Anfragen. Nutze den MCP Inspector zum Testen.

FileExistsError bei create_text_file

Es gibt schon eine Datei mit dem Namen. Wähle einen anderen Namen.

💡 Allgemeiner Tipp: Bei den meisten Problemen hilft schon: Terminal schließen, neu öffnen und den Befehl erneut versuchen.


✨ Eigene Tools hinzufügen

Möchtest du der KI ein neues Werkzeug geben? Öffne server.py und füge eine Funktion mit @mcp.tool() davor hinzu:

@mcp.tool()
def multiply(a: int, b: int) -> int:
    """Multipliziert zwei Zahlen"""
    return a * b

Wichtig:

  • @mcp.tool() über der Funktion macht sie für die KI sichtbar.

  • Der Text in """...""" (der sogenannte Docstring) erklärt der KI, was das Tool tut. Schreib ihn also verständlich!

  • Speichere die Datei und starte den Server neu.

Fertig – dein neues Werkzeug ist einsatzbereit! 🚀


🍌 Viel Spaß mit Banana!

Du hast es geschafft. Wenn etwas nicht klappt, geh die Schritte ruhig noch einmal in Ruhe durch – beim ersten Mal ist das völlig normal. Du machst das super. 💛

Available Tools

3 tools
addA

Add two numbers

ParametersJSON Schema
NameRequiredDescriptionDefault
aYes
bYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description alone must disclose behavioral traits. It states a pure mathematical operation with no side effects, which is adequate. However, it does not mention the return type or any potential edge cases.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise (3 words) and front-loaded. Every word is meaningful, and no extraneous information is present. For a simple tool, this is optimal.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (add two integers) and the presence of an output schema, the description is reasonably complete. It does not explain the return value, but the output schema presumably handles that. Slightly more context about overflow or result type could elevate it to 5.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description adds minimal meaning beyond the schema. It implies that 'a' and 'b' are the numbers to add, but does not elaborate on constraints, formats, or usage conventions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Add two numbers' clearly identifies the verb (add) and the resource (two numbers). It distinguishes the tool from siblings such as create_text_file and log_entry, which perform entirely different operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for adding two numbers, but provides no explicit guidance on when to use this tool versus alternatives, nor any exclusions or prerequisites. The context is clear but lacks differentiation advice.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

create_text_fileB

Creates a txt file with the given name and text content in the 'deine_texte' folder.

ParametersJSON Schema
NameRequiredDescriptionDefault
textYes
filenameYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It only states 'creates a txt file' without mentioning overwriting behavior, file size limits, permissions, or error handling. Insufficient for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence, no wasted words. However, additional information could be included without harming conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has an output schema (not shown) but description omits return value or side effects. With 2 simple parameters, this is minimally adequate but lacks details on folder specifics, filename rules, or text encoding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0% (no parameter descriptions). The description vaguely references 'given name and text content' but does not explain each parameter's format, constraints, or examples. Fails to compensate for schema gaps.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action (creates), the resource (txt file), and the location ('deine_texte' folder). It distinguishes this tool from siblings 'add' and 'log_entry' by specifying file creation vs. generic add or logging.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives, nor any conditions, exclusions, or prerequisites. The description only states what it does without contextual usage advice.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

log_entryA

Appends a timestamped log entry to 'banana.log' in the server folder.

ParametersJSON Schema
NameRequiredDescriptionDefault
messageYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Discloses it appends and timestamps, but without annotations, it does not specify behavior for missing file, permissions, or overwrite risks. Adequate for simple tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence, no wasted words, front-loads key action and target.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Has output schema (not shown) so return not needed, but misses details like file creation on demand or error handling. Adequate for simple tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema coverage, the description adds meaning by indicating 'message' is the log content to append. Lacks format or length constraints, partially compensating.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it appends a timestamped log entry to a specific file ('banana.log'), contrasting with siblings 'add' (generic) and 'create_text_file' (creates new file vs append).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Implies usage for logging messages to a specific file, but no explicit when-to-use or when-not-to-use guidance or alternatives mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 3 tool updatesv0.1.0
    • First observedadd
    • First observedcreate_text_file
    • First observedlog_entry

TDQS

B3.4/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: arithmetic, file creation, and logging. No overlap or ambiguity.

Naming Consistency2/5

Inconsistent naming: 'add' is a bare verb, while 'create_text_file' and 'log_entry' follow a verb_noun pattern. Mixed styles reduce predictability.

Tool Count5/5

Three tools is appropriate for a small utility server. Not too few or too many.

Completeness2/5

The tool set appears to be a random collection (arithmetic, file, logging) with no clear domain coverage. Missing any coherent lifecycle or purpose.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    A simple demonstration MCP server that provides a basic arithmetic tool for adding two numbers together, showcasing how to build custom MCP servers with input validation.
    15
    ISC
  • A
    license
    Not graded
    quality
    D
    maintenance
    A simple tutorial MCP server that provides a basic addition tool for adding two numbers together, demonstrating fundamental MCP server implementation.
    16
    ISC
  • F
    license
    Not graded
    quality
    C
    maintenance
    A lightweight MCP server providing tools for adding integers, getting current time, and fetching weather forecasts via wttr.in.
    -

Latest Blog Posts

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/Developer-Akademie-YouTube/Banana_MCP_Tutorial'

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