[[{“value”:”
Abstract: This article explores whether MCP is necessary when automating SAP Datasphere with AI. With SAP’s official CLI already available, is building an MCP Server the right approach — or can AI simply call the CLI directly?
Disclaimer: This article represents the author’s personal views and practical experience only, and does not represent the position of any company or organization. The technical analysis and cost calculations are based on specific scenarios and are for reference only.
1. Background
1.1 The Scenario
The goal was to use AI to automate SAP Datasphere operations, such as creating tables, views, and analytic models. For more details on this approach, see my previous article: Using Claude Code and Natural Language to Create SAP Datasphere Artifacts.
SAP provides an official command-line tool @sap/datasphere-cli, a fully-featured Node.js CLI that covers the main Datasphere operations:
Main Modules:
- objects – Manage Datasphere objects (tables, views, analytic models, data flows, etc.) including create, read, update, delete, and deploy
- spaces – Space management, including creation, configuration, and member management
- dbusers – Database user management, including user creation, password reset, and permission configuration
- marketplace – Data marketplace product installation and management
- tasks – Task chain execution and monitoring
- cache – Login credential cache management
Command Examples:
# Read the complete JSON structure of an existing object
datasphere objects views read --name EXISTING_VIEW --space MYSPACE
# Create a new object from a JSON file
datasphere objects tables create --file-path table.json --space MYSPACE
# Deploy objects to a specified space
datasphere objects deploy --space MYSPACE
# List database users in a space
datasphere dbusers list --space MYSPACE
# Run a task chain
datasphere tasks chains run --space MYSPACE --name DAILY_ETL
The CLI supports the --output json parameter, outputting structured JSON format, which is ideal for programmatic processing and AI parsing.
1.2 The Question
How do we enable AI (Claude) to call this CLI?
Two mainstream approaches:
- Approach A: Develop an MCP Server to wrap CLI functions as MCP tools for AI clients
- Approach B: Use Claude Code Agent to call CLI directly
2. MCP Approach Analysis
2.1 What is MCP
Model Context Protocol (MCP) is a standardized protocol proposed by Anthropic that enables AI to interact with external tools:
User → Claude Desktop → MCP Server (separate process) → Backend Services
↑
JSON-RPC 2.0
over stdio
2.2 Existing MCP Implementation
Before deciding to develop my own, I researched existing solutions. There’s already an open-source project mariodefe/sap-datasphere-mcp on GitHub that implements an MCP Server for SAP Datasphere. Following the principle of not reinventing the wheel, I analyzed this project to see if it could be used directly.
The project provides 48 MCP tools covering:
Module Tools Operations
| Space Management | 4 | List spaces, get space info, get space assets, etc. |
| Data Query | 6 | Execute SQL queries, smart queries, relational/analytical queries, etc. |
| Metadata Browsing | 12 | Search tables, get table schema, column distribution analysis, asset catalog browsing, etc. |
| Database User Management | 5 | Create/update/delete users, reset passwords |
| Task Management | 4 | Run task chains, view task logs, task history, etc. |
| Connection Management | 3 | List data source connections, test connections |
| Data Marketplace | 2 | Browse marketplace packages |
| Other | 12 | Tenant info, user info, OAuth scopes, search, etc. |
2.3 MCP’s Token Consumption Problem
The MCP protocol requires returning all tool descriptions via tools/list at initialization. I analyzed the actual data from this project:
- Total tool description characters: ~62,000 characters
- Estimated token count: ~15,500 tokens
Problem: These 15,500 tokens are counted in the context at the start of every conversation. Even if the user only wants to perform 1 simple operation, they pay for all 48 tool descriptions — this is a “hidden tax.”
Using Claude Sonnet 4.6 as an example ($3/million input tokens), MCP initialization consumes ~15,500 tokens:
Frequency MCP Initialization Cost
| Per session | $0.047 |
| 20 times/day | $0.93 |
| Per month | $27.90 |
| Per year | $339 |
Note: The above only calculates MCP tool description initialization costs, excluding actual conversation content and output. Pricing data from Anthropic official documentation (April 2026).
3. Alternative: Using Claude Code Agent to Call CLI Directly
3.1 Architecture Comparison
MCP Architecture:
Claude Desktop / Cursor / Other AI Clients
↓
JSON-RPC over stdio
↓
MCP Server (separate process, 8000+ lines of code)
↓
OAuth Handler / CLI Wrapper
↓
SAP Datasphere API / CLI
Agent Architecture:
Claude Code
↓
Bash tool (direct call)
↓
SAP Datasphere CLI
3.2 Advantages of the Agent Approach
Comparison MCP (48 tools) Agent
| Initialization Tokens | ~15,500 | 0 |
| Development Complexity | High (requires understanding MCP protocol, JSON-RPC, OAuth, etc.) | Low (define Skill + call CLI) |
| Separate Process | Required | Not required |
| Maintenance Cost | High (CLI updates require code changes and release) | Low (usually auto-compatible) |
| Debugging Difficulty | High (stdio communication) | Low (direct Bash output) |
3.3 Why CLI is Naturally Suited for AI Agents
CLI commands are inherently atomic operations:
datasphere objects tables create # Create a table
datasphere objects views read # Read a view
datasphere objects deploy # Deploy an object
datasphere dbusers list # List database users
This fragmented design aligns perfectly with how AI Agents work:
- Understand Intent – User says “create a sales analysis model”
- Decompose Task – AI breaks it down: create fact table → create dimension tables → create view → create model
- Execute Step by Step – Call CLI commands one by one
- Adapt Dynamically – Step failed? Read the error message, auto-correct and retry
MCP tries to “package” these atomic operations into predefined composite tools, which actually:
- Limits AI flexibility
- Cannot handle unforeseen scenarios
- Makes it harder to identify which step failed
CLI’s fragmentation + AI’s reasoning ability = flexible and controllable automation.
4. Other Issues with MCP
4.1 Maintenance Cost After CLI Updates
SAP Datasphere CLI receives regular updates. With MCP:
CLI Update
→ MCP Server code changes
→ Tool description updates
→ inputSchema adjustments
→ Test case updates
→ npm/pypi release new version
→ Users update dependencies
Taking sap-datasphere-mcp as an example, the project currently doesn’t implement CLI version detection — it neither checks the currently installed CLI version nor prompts users if the CLI needs updating. This means when SAP releases a new CLI version, users may encounter compatibility issues without knowing why.
With Agent directly calling CLI:
- Claude can directly read
datasphere --helpto get the latest commands - No additional adaptation layer needed
- Automatically adapts to new features
4.2 MCP Server is Essentially a “Translation Layer”
Claude Request → JSON-RPC → MCP Server → CLI Command → Parse Output → JSON-RPC → Claude
This translation layer requires:
- Parsing Claude’s JSON request
- Mapping to CLI commands
- Executing CLI
- Parsing CLI output
- Reformatting as MCP response
Problems:
- This translation layer adds complexity and potential errors
- CLI output format changes can cause parsing failures
- Need to handle all CLI error cases
4.3 Limited Flexibility
MCP requires predefined all possible operations. This means:
- Developers must anticipate all possible user needs in advance
- Each operation requires defining tool name, description, and parameter structure
- When new requirements emerge, code must be modified and a new version released
Taking sap-datasphere-mcp‘s 48 tools as an example, if a user wants to execute a CLI command that hasn’t been wrapped (like a feature added in a new CLI version), they cannot do it through MCP and must wait for the project to update.
Claude Code Agent doesn’t have this limitation — it can directly read datasphere --help, understand user intent, dynamically construct commands, and auto-adjust and retry on errors. Whatever the CLI can do, the AI can use.
5. When Does MCP Make Sense?
5.1 Scenarios Where MCP Fits
Scenario Reason
| Services without CLI | Can only access via REST API |
| Cross-client Reuse | Multiple clients (Claude Desktop, Cursor, etc.) using the same MCP Server |
| Enterprise Standardization | Organization needs unified toolsets and permission control |
| Strict Audit Requirements | Need to log and audit all AI operations |
5.2 Scenarios Where MCP is Not Needed
Scenario Reason
| Well-established CLI Exists | Direct calling is simpler and more efficient |
| Fast Iteration | Skill modifications take effect immediately, no release process needed |
| Cost Sensitive | MCP initialization tokens are an ongoing hidden cost |
| Individual/Small Team | No need for cross-client reuse |
6. Conclusion
6.1 For the SAP Datasphere Scenario
Based on my practice, with a well-established CLI available, I chose Claude Code Agent over MCP. Key considerations:
- SAP provides a fully-featured CLI (
@sap/datasphere-cli) - CLI supports JSON output, AI can parse directly
- Agent approach is more flexible, can automatically adapt to CLI updates
- Avoids MCP initialization token consumption
But this is just my choice based on specific requirements, and may not apply to all scenarios.
6.2 Open Question
While writing this article, I’ve been thinking about a question: As AI capabilities continue to grow, what is the long-term value of “middleware” like MCP?
When AI can already understand CLI documentation, parse JSON output, and auto-adjust based on errors, do we still need a predefined tool layer? Will MCP’s value increase as AI capabilities improve, or will it gradually be replaced by more flexible Agent approaches?
Perhaps time will tell. Feel free to share your perspective!
“}]]
[[{“value”:”Abstract: This article explores whether MCP is necessary when automating SAP Datasphere with AI. With SAP’s official CLI already available, is building an MCP Server the right approach — or can AI simply call the CLI directly?Disclaimer: This article represents the author’s personal views and practical experience only, and does not represent the position of any company or organization. The technical analysis and cost calculations are based on specific scenarios and are for reference only.1. Background1.1 The ScenarioThe goal was to use AI to automate SAP Datasphere operations, such as creating tables, views, and analytic models. For more details on this approach, see my previous article: Using Claude Code and Natural Language to Create SAP Datasphere Artifacts.SAP provides an official command-line tool @sap/datasphere-cli, a fully-featured Node.js CLI that covers the main Datasphere operations:Main Modules:objects – Manage Datasphere objects (tables, views, analytic models, data flows, etc.) including create, read, update, delete, and deployspaces – Space management, including creation, configuration, and member managementdbusers – Database user management, including user creation, password reset, and permission configurationmarketplace – Data marketplace product installation and managementtasks – Task chain execution and monitoringcache – Login credential cache managementCommand Examples:# Read the complete JSON structure of an existing object
datasphere objects views read –name EXISTING_VIEW –space MYSPACE
# Create a new object from a JSON file
datasphere objects tables create –file-path table.json –space MYSPACE
# Deploy objects to a specified space
datasphere objects deploy –space MYSPACE
# List database users in a space
datasphere dbusers list –space MYSPACE
# Run a task chain
datasphere tasks chains run –space MYSPACE –name DAILY_ETLThe CLI supports the –output json parameter, outputting structured JSON format, which is ideal for programmatic processing and AI parsing.1.2 The QuestionHow do we enable AI (Claude) to call this CLI?Two mainstream approaches:Approach A: Develop an MCP Server to wrap CLI functions as MCP tools for AI clientsApproach B: Use Claude Code Agent to call CLI directly2. MCP Approach Analysis2.1 What is MCPModel Context Protocol (MCP) is a standardized protocol proposed by Anthropic that enables AI to interact with external tools:User → Claude Desktop → MCP Server (separate process) → Backend Services
↑
JSON-RPC 2.0
over stdio2.2 Existing MCP ImplementationBefore deciding to develop my own, I researched existing solutions. There’s already an open-source project mariodefe/sap-datasphere-mcp on GitHub that implements an MCP Server for SAP Datasphere. Following the principle of not reinventing the wheel, I analyzed this project to see if it could be used directly.The project provides 48 MCP tools covering:Module Tools OperationsSpace Management4List spaces, get space info, get space assets, etc.Data Query6Execute SQL queries, smart queries, relational/analytical queries, etc.Metadata Browsing12Search tables, get table schema, column distribution analysis, asset catalog browsing, etc.Database User Management5Create/update/delete users, reset passwordsTask Management4Run task chains, view task logs, task history, etc.Connection Management3List data source connections, test connectionsData Marketplace2Browse marketplace packagesOther12Tenant info, user info, OAuth scopes, search, etc.2.3 MCP’s Token Consumption ProblemThe MCP protocol requires returning all tool descriptions via tools/list at initialization. I analyzed the actual data from this project:Total tool description characters: ~62,000 charactersEstimated token count: ~15,500 tokensProblem: These 15,500 tokens are counted in the context at the start of every conversation. Even if the user only wants to perform 1 simple operation, they pay for all 48 tool descriptions — this is a “hidden tax.”Using Claude Sonnet 4.6 as an example ($3/million input tokens), MCP initialization consumes ~15,500 tokens:Frequency MCP Initialization CostPer session$0.04720 times/day$0.93Per month$27.90Per year$339Note: The above only calculates MCP tool description initialization costs, excluding actual conversation content and output. Pricing data from Anthropic official documentation (April 2026).3. Alternative: Using Claude Code Agent to Call CLI Directly3.1 Architecture ComparisonMCP Architecture:Claude Desktop / Cursor / Other AI Clients
↓
JSON-RPC over stdio
↓
MCP Server (separate process, 8000+ lines of code)
↓
OAuth Handler / CLI Wrapper
↓
SAP Datasphere API / CLIAgent Architecture:Claude Code
↓
Bash tool (direct call)
↓
SAP Datasphere CLI3.2 Advantages of the Agent ApproachComparison MCP (48 tools) AgentInitialization Tokens~15,5000Development ComplexityHigh (requires understanding MCP protocol, JSON-RPC, OAuth, etc.)Low (define Skill + call CLI)Separate ProcessRequiredNot requiredMaintenance CostHigh (CLI updates require code changes and release)Low (usually auto-compatible)Debugging DifficultyHigh (stdio communication)Low (direct Bash output)3.3 Why CLI is Naturally Suited for AI AgentsCLI commands are inherently atomic operations:datasphere objects tables create # Create a table
datasphere objects views read # Read a view
datasphere objects deploy # Deploy an object
datasphere dbusers list # List database users
This fragmented design aligns perfectly with how AI Agents work:Understand Intent – User says “create a sales analysis model”Decompose Task – AI breaks it down: create fact table → create dimension tables → create view → create modelExecute Step by Step – Call CLI commands one by oneAdapt Dynamically – Step failed? Read the error message, auto-correct and retryMCP tries to “package” these atomic operations into predefined composite tools, which actually:Limits AI flexibilityCannot handle unforeseen scenariosMakes it harder to identify which step failedCLI’s fragmentation + AI’s reasoning ability = flexible and controllable automation.4. Other Issues with MCP4.1 Maintenance Cost After CLI UpdatesSAP Datasphere CLI receives regular updates. With MCP:CLI Update
→ MCP Server code changes
→ Tool description updates
→ inputSchema adjustments
→ Test case updates
→ npm/pypi release new version
→ Users update dependenciesTaking sap-datasphere-mcp as an example, the project currently doesn’t implement CLI version detection — it neither checks the currently installed CLI version nor prompts users if the CLI needs updating. This means when SAP releases a new CLI version, users may encounter compatibility issues without knowing why.With Agent directly calling CLI:Claude can directly read datasphere –help to get the latest commandsNo additional adaptation layer neededAutomatically adapts to new features4.2 MCP Server is Essentially a “Translation Layer”Claude Request → JSON-RPC → MCP Server → CLI Command → Parse Output → JSON-RPC → ClaudeThis translation layer requires:Parsing Claude’s JSON requestMapping to CLI commandsExecuting CLIParsing CLI outputReformatting as MCP responseProblems:This translation layer adds complexity and potential errorsCLI output format changes can cause parsing failuresNeed to handle all CLI error cases4.3 Limited FlexibilityMCP requires predefined all possible operations. This means:Developers must anticipate all possible user needs in advanceEach operation requires defining tool name, description, and parameter structureWhen new requirements emerge, code must be modified and a new version releasedTaking sap-datasphere-mcp’s 48 tools as an example, if a user wants to execute a CLI command that hasn’t been wrapped (like a feature added in a new CLI version), they cannot do it through MCP and must wait for the project to update.Claude Code Agent doesn’t have this limitation — it can directly read datasphere –help, understand user intent, dynamically construct commands, and auto-adjust and retry on errors. Whatever the CLI can do, the AI can use.5. When Does MCP Make Sense?5.1 Scenarios Where MCP FitsScenario ReasonServices without CLICan only access via REST APICross-client ReuseMultiple clients (Claude Desktop, Cursor, etc.) using the same MCP ServerEnterprise StandardizationOrganization needs unified toolsets and permission controlStrict Audit RequirementsNeed to log and audit all AI operations5.2 Scenarios Where MCP is Not NeededScenario ReasonWell-established CLI ExistsDirect calling is simpler and more efficientFast IterationSkill modifications take effect immediately, no release process neededCost SensitiveMCP initialization tokens are an ongoing hidden costIndividual/Small TeamNo need for cross-client reuse6. Conclusion6.1 For the SAP Datasphere ScenarioBased on my practice, with a well-established CLI available, I chose Claude Code Agent over MCP. Key considerations:SAP provides a fully-featured CLI (@sap/datasphere-cli)CLI supports JSON output, AI can parse directlyAgent approach is more flexible, can automatically adapt to CLI updatesAvoids MCP initialization token consumptionBut this is just my choice based on specific requirements, and may not apply to all scenarios.6.2 Open QuestionWhile writing this article, I’ve been thinking about a question: As AI capabilities continue to grow, what is the long-term value of “middleware” like MCP?When AI can already understand CLI documentation, parse JSON output, and auto-adjust based on errors, do we still need a predefined tool layer? Will MCP’s value increase as AI capabilities improve, or will it gradually be replaced by more flexible Agent approaches?Perhaps time will tell. Feel free to share your perspective!”}]] Read More Technology Blog Posts by SAP articles
#SAPCHANNEL