Back/Engineering/Devin
IntermediateEngineering

How to Integrate a New Server into a Codebase with Devin AI and DeepWiki

Use DeepWiki to locate the code and conventions behind a small integration, turn that context into a bounded Devin task, and let the agent work asynchronously toward a reviewable pull request.

How to Integrate a New Server into a Codebase with Devin AI and DeepWiki

Scott opens the repository in DeepWiki, finds the MCP marketplace implementation and reference files, turns a short request into a context rich Devin task, lets Devin research and code asynchronously, and expects a pull request for review.

Before you start

What you need

  • A repository Devin and DeepWiki may access
  • A small integration task with a clear user and system outcome
  • Existing implementations that show the preferred pattern
  • Official documentation for the server, API, or dependency being added
  • Documented test, lint, build, security, and pull request requirements

What you’ll make

A narrow pull request that follows the repository pattern, adds the integration and tests, cites external documentation used, and explains its behavior, risks, and remaining questions.

Tools used

  • Devin

    AI software engineer by Cognition Labs

Step by step

The workflow

Follow the sequence once, then adapt the prompts, checks, and handoffs to your own setup.

4 steps

Step01

Understand the Codebase with DeepWiki

Use DeepWiki to ask where comparable servers are registered, configured, rendered, and tested. Open the cited source files and note the common type shape, validation, permissions, documentation, and test pattern.

Example prompt
Show where [integration category] entries are registered, configured, displayed, and tested in this repository. Cite the exact files and symbols, compare two existing examples, and list assumptions or repository conventions I should confirm before adding another one.
Step02

Craft a Context-Rich Prompt for Devin

Turn the integration request into a bounded Devin task. Include the desired behavior, relevant files and examples, official external documentation, configuration and secret handling, tests, non goals, and the definition of done.

Example prompt
Add [server or integration] by following the existing patterns in [files and examples]. Use the official documentation at [URL] for [supported version]. Implement [behavior]. Keep secrets out of code and logs. Stay within [scope]. Add or update [tests and docs], run [commands], and open a pull request that explains the diff, evidence, risks, and remaining questions.
Step03

Initiate Asynchronous Execution

Start the Devin session on its own branch and let it research and implement asynchronously. Respond to concrete questions with repository or product context, while keeping unrelated tasks in separate sessions to avoid overlapping changes.

Step04

Review and Merge the Pull Request

Review the pull request against the original task, official documentation, and repository pattern. Inspect the diff, configuration, permissions, dependency changes, tests, and generated artifacts, then run the required checks before merging.

What good looks like

  • DeepWiki points to the relevant implementation and the task prompt cites those files or components.
  • The pull request changes only the necessary files and does not expose credentials or weaken repository protections.
  • Tests, types, lint, and build checks pass using the repository's documented commands.
  • The reviewer can validate the new integration against official documentation and explain how to revert it.

Build your next product with ChatPRD

Turn an idea into a PRD, user stories, and a plan.

Try ChatPRD free

After the steps

Runbook notes

How to recover when the loop fails and where human judgment helps.

Recover

If it goes sideways

DeepWiki identifies a nearby pattern that does not apply to the new integration
Inspect the cited code and compare more than one existing server before defining the task.
The agent relies on search snippets or outdated integration details
Provide the official documentation and supported version, and require links for any external behavior it implements.
A token or credential appears in the prompt, logs, fixture, or pull request
Use secret references and approved test credentials, scan the diff and logs, and rotate anything exposed.
The pull request adds unrelated cleanup or changes the shared pattern unnecessarily
Set a file and behavior boundary, review the diff, and move optional refactors to a separate task.

Start shipping
better products.

Join 100,000+ product managers who use ChatPRD to write better docs, align teams faster, and build products users love.

Free to start
No credit card
SOC 2 certified
Enterprise ready