Skip to content

Commit 0e031f7

Browse files
chore(docs): Remove outdated custom integration section from README
[skip ci]
1 parent a06d1bd commit 0e031f7

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

README.md

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ The server uses a decoupled architecture:
143143
* **`Protocol`:** Internal bridge listening to transport events, interacting with `Processor` and `ClientStateManager`.
144144
* **`discover()` Method:** An **explicit** method on the `Server` instance to trigger attribute discovery. Takes path configurations as arguments. By default, it clears previously discovered/cached elements before scanning and saves the new results to cache (if enabled).
145145
* **`listen()` Method:** Starts the server using a specific transport. Binds the `Protocol`, starts the transport listener, and **runs the event loop (blocking)**. Performs a pre-check and warns if no elements are registered and discovery hasn't run.
146-
* **`getProtocol()` Method:** For framework integration (see below).
147146

148147
## Defining MCP Elements
149148

@@ -282,22 +281,6 @@ $server->listen($transport);
282281
* **SSE:** `GET /{mcpPathPrefix}/sse` (e.g., `GET /mcp/sse`) - Client connects here.
283282
* **Messages:** `POST /{mcpPathPrefix}/message?clientId={clientId}` (e.g., `POST /mcp/message?clientId=sse_abc123`) - Client sends requests here. The `clientId` query parameter is essential for the server to route the message correctly to the state associated with the SSE connection. The server sends the POST path (including the generated `clientId`) via the initial `endpoint` SSE event to the client, so you will never have to manually handle this.
284283

285-
### Custom / Framework Integration
286-
287-
Integrate into frameworks without the blocking `listen()` call:
288-
289-
1. **Build Server:** `$server = Server::make()->...->build();`, likely as a service container singleton.
290-
2. **(Optional) Discover:** `$server->discover(...);` (Perhaps in a cache warmup command).
291-
3. **Get Protocol:** Obtain the protocol from the server: `$protocol = $server->getProtocol();`
292-
4. **Bridge Transport Events:** In your framework's request handling (HTTP controller, WebSocket):
293-
* When a new connection is established: `$protocol->handleClientConnected($clientId);`
294-
* When a raw JSON-RPC message frame is received, call: `$protocol->handleRawMessage($rawJsonFrame, $clientId);`
295-
* When a connection closes, call: `$protocol->handleClientDisconnected($clientId, $reason);`
296-
* Handle transport-level errors by potentially calling: `$protocol->handleTransportError($exception, $clientId);`
297-
5. **Sending Responses:** You'll need framework-specific logic to send responses/notifications back to the correct client connection identified by `$clientId`.
298-
299-
This approach allows the framework to manage the event loop, sockets, and request/response objects, while leveraging the `php-mcp/server` core for MCP processing logic.
300-
301284
## Connecting MCP Clients
302285

303286
Instruct clients how to connect to your server:
@@ -565,7 +548,6 @@ See the [`examples/`](./examples/) directory:
565548
* **`05-stdio-env-variables/`**: `stdio` server with a tool that uses environment variables passed by the MCP client.
566549
* **`06-custom-dependencies-stdio/`**: `stdio` server showing DI container usage for injecting services into MCP handlers (Task Manager example).
567550
* **`07-complex-tool-schema-http/`**: `http+sse` server with a tool demonstrating complex input schemas (optionals, defaults, enums).
568-
* *(Conceptual framework example to be added)*
569551

570552
## Testing
571553

0 commit comments

Comments
 (0)