iTranslated by AI
Claude Code: An Easy Guide to Project Setup and MCP Integration
Easy Even for a Rabbit! Claude Code Project Settings and MCP Utilization Guide
Hello, this is Rabbit! Today, I'll introduce some convenient ways to use "Claude Code," a new development tool provided by Anthropic. I'll be delivering practical content, specifically focusing on project settings, how to utilize MCP (Model Context Protocol), and methods for API integration.
What is Claude Code?
Claude Code is a terminal-based agentic coding tool developed by Anthropic. It supports various developer tasks such as code understanding, refactoring, debugging, and documentation. A key feature is the ability to leverage the powerful capabilities of the Claude LLM directly from the terminal. It is currently available as a beta version in research preview.

Basic Commands
In Claude Code, you can control the behavior of the Claude LLM using various slash commands. The main commands include:
-
/help- Display help and available commands -
/init- Initialize a project with a CLAUDE.md file -
/clear- Clear conversation history -
/compact [instruction]- Compact the focused conversation with optional instructions -
/config- Check or change settings -
/cost- Display token usage statistics -
/doctor- Check the health of the Claude Code installation -
/memory- Edit the CLAUDE.md memory file
Personally, I use /init, /memory, and /help quite often—just remembering these should be enough for your first time, pyon!
CLI Operations
Basic CLI commands to operate Claude Code from the terminal are as follows:
# Start interactive REPL
claude
# Start REPL with an initial prompt
claude "Explain the project"
# Run a one-off query and exit
claude -p "Explain this function"
# Process input from a pipe
cat logs.txt | claude -p "Explain this"
# Configure settings
claude config set --global theme dark
These are all simple commands that even a rabbit can easily use, so you can feel at ease, pyon!
How to Create a Project
Installation Steps
First, let's install Claude Code. Node.js 18 or higher is required.
# Global installation (do not use sudo!)
npm install -g @anthropic-ai/claude-code
# Move to the project directory
cd your-project-directory
# Start Claude Code
claude
Rabbit's One-Point Advice: Do not use sudo npm install -g! It can lead to permission issues or security risks. If you encounter problems, we recommend creating a new user-writable npm prefix:
# Save the list of global packages
npm list -g --depth=0 > ~/npm-global-packages.txt
# Create a directory for global packages
mkdir -p ~/.npm-global
# Configure npm to use the new directory path
npm config set prefix ~/.npm-global
# Update PATH (select the appropriate file for your shell)
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
Project Initialization
When starting a project, you can use the /init command to generate a CLAUDE.md file and introduce basic settings for Claude Code to your project. This guide includes basic information for the Claude LLM to understand your project.
# Start Claude Code in the project directory
cd your-project-directory
claude
# Run the project initialization command
/init
Running this will generate a CLAUDE.md file in the project directory. You can describe basic information and instructions for the project in this file.
Using Development Containers
Claude Code also provides development container configurations for teams that require a consistent and secure environment. This pre-configured devcontainer setting works seamlessly with VS Code's Remote - Containers extension and similar tools. This allows all developers to work in the same environment and avoids the "it works on my machine" problem.
How to Set Project Instructions
In Claude Code, you can provide specific instructions and settings for each project. This allows the Claude LLM to understand the characteristics and requirements of the project and provide more accurate assistance.

CLAUDE.md File
At the center of Claude Code is the CLAUDE.md file. This file functions as the Claude LLM's "memory," storing important information and instructions about the project.
# Project Instructions
This project is a Node.js-based web application.
The main features are user authentication and data visualization.
# Coding Style
- Follow ESLint rules
- Functions should be small and follow the Single Responsibility Principle
- Use async/await for asynchronous processing
# Project Structure
- src/: Source code
- tests/: Test code
- docs/: Documentation
Memory File Locations
CLAUDE.md files can be placed in multiple locations:
-
Project Root (most common): Can be included in the git repository as
CLAUDE.md, or added to.gitignoreasCLAUDE.local.mdfor personal settings. -
Parent Directory: In the case of a monorepo, if you run Claude in
root/foo, it can automatically pull bothroot/CLAUDE.mdandroot/foo/CLAUDE.mdinto context. -
Subdirectories: When Claude Code operates on files in a subdirectory, it reads the
CLAUDE.mdfile in that subdirectory as needed. -
Home Folder: Placing it at
~/.claude/CLAUDE.mdapplies it to all Claude Code sessions.
Rabbit Note: If multiple CLAUDE.md files exist, Claude Code reads them recursively. It starts from the parent directory and reads all CLAUDE.md or CLAUDE.local.md files up to the current working directory, pyon!
Editing Memory
There are several ways to edit the memory file in Claude Code:
- Use the
/memorycommand to edit directly. - Edit the file with a regular text editor.
- New feature: Press the
#key to add memory directly (e.g., typing# Please follow the task formatadds it to memory).
Custom Slash Commands
For recurring workflows (debugging loops, log analysis, etc.), you can save prompt templates as Markdown files within the .claude/commands folder. These will become available from the slash command menu that appears when you type /.
By checking these commands into git, you can make them available to the entire team. Each team member can also add their own unique commands, leading to greater efficiency.
How to Configure MCP
The Model Context Protocol (MCP) is an open protocol for large language models (LLMs) to access external tools and data sources. In Claude Code, you can utilize this MCP to collaborate with various external tools.

What is MCP?
MCP adopts a client-server architecture, allowing Claude Code (the client) to connect to various specialized servers. This provides the LLM with the ability to access external tools and data sources.
Note: Use third-party MCP servers at your own risk. Be particularly cautious when using MCP servers that communicate with the internet, as they may expose you to prompt injection risks.
Basics of MCP Configuration
To configure an MCP server in Claude Code, use the claude mcp command:
# Basic syntax
$ claude mcp add [args...]
# Example of adding a local server
$ claude mcp add my-server -e API_KEY=123 -- /path/to/server arg1 arg2
# List configured servers
$ claude mcp list
# Get details for a specific server
$ claude mcp show my-server
You can use the -s or --scope flag to specify where the settings are saved:
-
project(default): Available when running in the project directory -
global: Available in all projects
Environment variables can be set with the -e or --env flag (e.g., -e KEY=value).
How to Utilize MCP
Claude Code functions as both an MCP server and a client. As a client, it can connect to any number of MCP servers to access their tools:
- Database connections such as PostgreSQL
- Web automation with Puppeteer
- Integration with Sentry and other monitoring tools
Rabbit's One-Point: If you need help debugging the startup of an MCP server, starting Claude with the --mcp-debug flag can help identify configuration issues, pyon!
How to Automatically Approve MCP
By default, Claude Code requests permission for actions that could potentially change the system (file writing, many bash commands, MCP tools, etc.). This is an intentionally conservative approach prioritizing safety. However, there are several ways to automate this permission process.
How to Configure Automatic Approval
There are four ways to configure automatic approval for MCP tools:
-
Select "Always allow" during a session
If you select "Always allow" in the prompt displayed when using a tool during a session, it will be automatically permitted for the duration of that session. -
Use the
/allowed-toolscommand
After starting Claude Code, you can use the/allowed-toolscommand to add or remove tools from the allowed list. For example:-
Edit- Always allow file editing -
Bash(git commit:*)- Allow git commits -
mcp__puppeteer__puppeteer_navigate- Allow navigation on the Puppeteer MCP server
-
-
Manual editing of configuration files
You can directly edit.claude/settings.jsonor~/.claude.json(we recommend checking the former into source control to share with your team). -
Checking in the
.mcp.jsonfile
For example, by adding Puppeteer or Sentry servers to.mcp.json, everyone working on the codebase will be able to use them immediately.
Approval Settings Considering Safety
When configuring automatic approval, it's important to consider the balance of safety:
-
Read-only tools -
Bash(ls:*),GrepTool, etc., are relatively safe. -
Write tools - Be cautious with
Edit,Replace,Bash(rm:*), etc. - External access tools - MCP tools that access the internet require the most caution due to the risk of prompt injection.
Rabbit Note: You can set both allow and deny rules, but deny rules take precedence over allow rules, pyon!
How to Externalize as an API
To integrate Claude Code features with external services or share them with a broader team, externalizing as an API is an effective method.

Integration Through the Claude API
Claude Code is built on Anthropic's Claude API. You can use this API to integrate Claude Code with your own applications and services.
Key features:
- Text and code generation: Detailed responses, code generation, debugging, etc.
- 200K token context window: Effectively process large datasets and long conversations.
- Tool integration: Collaborate with external tools for more dynamic functionality.
- Advanced security: Sensitive data processing with SOC 2 Type II compliance and HIPAA options.
- SDK support: Easy integration with Python and TypeScript.
Environment Standardization via Dev Container Settings
To achieve a consistent environment across the entire team, Claude Code provides development container configurations. This setup integrates with tools like VS Code's Remote - Containers extension, ensuring all developers can use Claude Code in the same environment.
This allows for:
- Avoiding issues caused by environmental differences
- Simplifying onboarding for new members
- Centralizing tool version management
Integration Utilizing SDKs
The Claude API primarily offers two SDKs:
- Python SDK
import anthropic
# Initialize Claude client
client = anthropic.Anthropic()
# Call the model
response = client.messages.create(
model="claude-3-opus-20240229",
max_tokens=1000,
messages=[
{"role": "user", "content": "Please tell me the issues with this code"}
]
)
- TypeScript SDK
import { Anthropic } from '@anthropic-ai/sdk';
// Initialize Claude client
const anthropic = new Anthropic({
apiKey: process.env.ANTHROPIC_API_KEY,
});
// Call the model
const response = await anthropic.messages.create({
model: 'claude-3-opus-20240229',
max_tokens: 1000,
messages: [
{ role: 'user', content: 'Please tell me the issues with this code' }
],
});
Security Considerations
When externalizing as an API, it's important to pay attention to the following security considerations:
- API Key Management: Do not publish your API key in public locations (source code repositories, blog posts, social media posts, etc.).
- Access Control: Implement scope-based access control and rate limiting.
- Compliance: Options for SOC 2 Type II compliance and HIPAA support (health information protection).
- Data Protection: Encryption of data in transit, protection of stored data, and maintenance of access audit logs.
Rabbit Warning: Even when using Claude Code in the terminal, be very careful with API Key management, pyon!
Application Examples and Practical Techniques
Practical Use Cases in Actual Development
-
Accelerating Onboarding
At Anthropic, Claude Code is used to significantly reduce engineer ramp-up time, easing the burden on other engineers. No special prompts are required; by simply asking questions, Claude explores the code and finds the answers. -
Interaction with Git
Many Anthropic engineers perform over 90% of their git operations through Claude Code. Routine git tasks such as creating commit messages, performing code reviews, and managing pull requests are streamlined. -
Efficient Debugging
The debugging process is made significantly more efficient through error message diagnosis and fix suggestions. You can share errors with Claude, receive suggested fixes, and apply them directly.
Tips for Efficiency
-
Narrowing Down Context
In long sessions, irrelevant conversations, file contents, and commands can accumulate in the Claude LLM's context window, potentially degrading performance. Frequently use the/clearcommand between tasks to reset the context window. -
Utilizing Extended Thinking Mode
Claude Code (Claude 3.7 Sonnet) supports Extended Thinking mode. For tasks that require more planning, you can instruct the Claude LLM to "think" or "think deeply" to encourage deeper reasoning. -
Utilizing Custom Slash Commands
For recurring workflows (debugging loops, log analysis, etc.), save prompt templates as Markdown files within the.claude/commandsfolder. These will be available via the slash command menu that appears when you type/.
Troubleshooting
-
Installation Issues
To avoid permission issues and security risks, do not usesudo npm install -g. Instead, we recommend creating a new user-writable npm prefix. -
MCP Server Connection Issues
If you need help debugging the startup of an MCP server, launch Claude with the--mcp-debugflag. This will help you identify configuration problems. -
Context Length Issues
For long contexts, placing long-form data (~20K+ tokens) at the top of the prompt and the query or task instructions at the bottom significantly improves Claude's performance.
Summary
Claude Code, as a terminal-integrated AI coding tool developed by Anthropic, is a powerful assistant that understands the codebase and streamlines daily developer tasks. In this article, we introduced a wide range of Claude Code features and applications, from basic usage to project settings, MCP utilization, and API integration.
The following points are particularly important:
- Project Instruction Settings: By providing project-specific instructions and settings through the CLAUDE.md file, you can receive more accurate assistance.
- MCP Utilization: You can extend the capabilities of the Claude LLM through integration with external tools and data sources.
- Automatic Approval Settings: By automating the approval of frequently used tools and commands, you can smooth out your workflow.
- API Integration: Integration with your own applications and services is possible by leveraging the Claude API and SDKs.
Claude Code is currently offered as a beta version (research preview), but further feature additions and improvements are expected in the future. Its potential is expanding significantly as a tool that helps developers streamline routine coding tasks and focus on more creative problem-solving.
I'm also utilizing Claude Code in my daily development, and the support for code understanding, refactoring, and debugging has been especially helpful. Everyone, please give Claude Code a try and innovate your development workflow, pyon!
Discussion