# PsChina/deepseek-as-subagent [Health: Active]

**Category:** 🤖 Coding Agents  
**Repository:** https://github.com/PsChina/deepseek-as-subagent  
**GitHub Stars:** 62  
**Views:** 2  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/pschina-deepseek-as-subagent

## Description
Run DeepSeek as a real sub-agent inside Claude Code / Codex CLI. DeepSeek gets its own 7-tool agent loop (Read/Write/Edit/Bash/Glob/Grep/NotebookEdit) in a sandboxed workspace, not just a single LLM call. Includes token-based command sandbox, pre-flight web-search pattern, and cross-platform installer.

## Claude Desktop Quick Installation
No generated config for this server: it installs through its own setup steps.

The project's own setup steps (from https://github.com/PsChina/deepseek-as-subagent), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Install:

```sh
git clone https://github.com/PsChina/deepseek-as-subagent.git
```

2. Install:

```sh
cd deepseek-as-subagent
```

3. Install:

```sh
./install.sh
```

4. Install:

```sh
git clone https://github.com/PsChina/deepseek-as-subagent
```

5. Install:

```sh
bash adapters/codex/install.sh
```

## Documentation

## What PsChina/deepseek-as-subagent does

PsChina/deepseek-as-subagent exposes DeepSeek through an MCP server implemented in Python and connected over stdio. It is designed for Claude Code and Codex CLI, and is also listed for use with Cursor, Cline, and Claude Desktop. The provider connection uses an OpenAI-compatible Chat Completions API, so the configured backend can be DeepSeek's hosted service or a compatible local model.

The main distinction is that the delegated model receives its own agent loop rather than one prompt-and-response call. The host agent can pass a complete logical unit of work, allowing the sub-agent to inspect the workspace, perform actions, and return a result for host-side verification.

## How it works

Coding delegation provides Read, Write, Edit, Bash, Glob, Grep, and NotebookEdit capabilities. File operations are restricted to the configured workspace, and outbound symlinks are rejected. Bash runs on the trusted host with the workspace as its working directory; commands are bounded and credential-isolated, but this is not an operating-system sandbox.

Read-only delegation uses only Read, Glob, and Grep. It can review files, search the workspace, and perform static analysis without command execution or file mutation. Both modes support synchronous delegation and background jobs. A background task returns a job ID that can be used to send another message, check status, cancel the task, or retrieve its result.

Optional Task Contracts add per-delegation tool permissions, workspace-relative file scopes, and limits on tool calls and mutations. Contract-aware execution disables Bash, checks scopes during dispatch and after canonical path resolution, and preserves built-in secret-path denials. Results include policy checks, resource accounting, mutation digests, and host-observed workspace readback for review.

## Setup and configuration

The project supports macOS, Linux, and Windows, and requires Python 3.10 through 3.12. For Claude Code, clone the repository and run `./install.sh`. For Codex CLI, run `bash adapters/codex/install.sh` from the repository. The installers create an isolated runtime, validate the configuration and MCP protocol, then update the host registration.

Hosted DeepSeek access uses `DEEPSEEK_API_KEY`. On POSIX systems, the key can be placed in `~/.deepseek-mcp/config.json`; on Windows, set the environment variable. A local loopback OpenAI-compatible server does not require a DeepSeek key. Provider profiles include `flash` and `pro`, while the actual provider model IDs are controlled through configuration.

## Tools and capabilities

The server includes these delegation entry points:

- `delegate_to_deepseek` for coding work
- `delegate_to_deepseek_readonly` for read-only analysis
- `start_deepseek` and `start_deepseek_readonly` for background jobs
- Shared controls for sending messages, checking status, cancelling jobs, and retrieving results
- Contract-aware variants with scoped permissions and budgets

The coding path also includes a crash-safe mutation journal for Write, Edit, and NotebookEdit operations, recovery queries, file verification, and acknowledgement before another mutation-capable delegation. A cross-process execution lease prevents concurrent DeepSeek runs against the same workspace.

## Limitations and notes

Trusted-host Bash is not an OS-level sandbox, and Bash changes are not covered by the mutation journal. Contract results provide review evidence rather than proof of functional correctness or complete isolation. Mutation-capable hosts must complete the recovery, verification, and acknowledgement flow before starting another delegation; read-only usage does not require that handshake.

The server uses stdio transport. Local Python module signatures are implementation details rather than a stable public interface, and clients should not depend on exact health or error message text. Installers retain the active generation and one previous generation for recovery, and manual runtimes must remain outside delegated workspaces when file mutation is enabled.

_Full upstream README: https://allmcps.com/mcp/pschina-deepseek-as-subagent/readme_

