Download the PHP package dv-team/mcp-server without Composer

On this page you can find all versions of the php package dv-team/mcp-server. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package mcp-server

PHP MCP Server

This project demonstrates a simple PHP-based MCP Server (JSON-RPC) for handling requests that can respond immediately. It is designed for flexibility and can be adapted to various environments, such as database schema retrieval, prompt output, filesystem tasks, and more.

High-Level Goals

Requirements

Installation

Usage

Implemented JSON-RPC methods

STDIO server (main)

Logs are written to stdio–mcp.log (note the filename contains an en dash ).

Streamable-HTTP via supergateway (optional)

This server speaks STDIO only. If you need Streamable-HTTP, use the supergateway tool to bridge STDIO to HTTP while keeping the PHP server unchanged.

Short example (stdio → Streamable-HTTP):

The Streamable-HTTP endpoint defaults to http://localhost:8000/mcp. See the supergateway README for more options.

Streamable-HTTP bridge via src-http (Bun)

If you prefer a Bun-based Streamable-HTTP bridge (chunked HTTP), use the project in src-http/ to connect the PHP MCP CLI to an HTTP endpoint:

The Bun server exposes POST /mcp and forwards each request to the PHP CLI over STDIO. Configure OAuth2 and other options via .env (see src-http/.env.example). OAuth is enforced by default; set MCP_REQUIRE_AUTH=false to disable.

Optional tracing: set MCP_CLI_TRACE_STDOUT=true to echo MCP request/response lines to stdout.

Example servers

The examples/ folder is a separate Composer project. Install its dependencies first:

STDIO sample that logs requests/responses to examples/src/stdio–mcp.log:

Example: Registering Prompts

The server uses YAML front-matter to parse Markdown files and register them as prompts, as shown in examples/src/prompts-and-tools-cli.php:

Example: Registering Tools

Here are three simple tools you might register:

Example: Attribute-Based Tools

You can mark methods with attributes and let the AttributeToolRegistrar build the MCP tool definitions for you:

Descriptions on parameters are copied into the generated schema; when a property is not supplied in parametersSchema, the registrar infers the JSON Schema type and required flag from the method signature.

Tool Annotations

Tools may carry an optional annotations object whose properties are hints about the tool's behavior. The MCP spec defines the keys below; all are optional. Clients use them to render UI hints (e.g. a "destructive" badge) or to decide which tools to expose without user confirmation.

Key Type Meaning
title string Human-readable title for the tool.
readOnlyHint bool If true, the tool does not modify its environment. Default: false.
destructiveHint bool If true, the tool may perform destructive updates. Only meaningful when readOnlyHint == false. Default: true.
idempotentHint bool If true, repeated calls with the same arguments have no additional effect. Only meaningful when readOnlyHint == false. Default: false.
openWorldHint bool If true, the tool may interact with an open world of external entities (e.g. web search). If false, its domain is closed (e.g. an in-memory tool). Default: true.

Annotations are hints, not guarantees — never make trust decisions based on annotations received from an untrusted server. See the MCP specification for the canonical definition.

Pass annotations as a stdClass to MCPServer::registerTool() (cast an array with (object) [...] as shown in the examples) or as an associative array to #[MCPTool]. registerTool() also accepts an optional outputSchema parameter — a JSON-Schema object describing the tool's structured result — which is forwarded to the client alongside inputSchema.

The shipped JSON schema at schema/2025-11-25/schema.json is used by the test suite to validate that registered tools conform to the spec, annotations included.

Notes

License

MIT License


All versions of mcp-server with dependencies

PHP Build Version
Package Version
Requires php Version >= 8.2
psr/log Version >= 1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package dv-team/mcp-server contains the following files

Loading the files please wait ...