MCPcopy Index your code
hub / github.com/dreamhead/moco

github.com/dreamhead/moco @v1.6.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.6.1 ↗ · + Follow
3,253 symbols 16,670 edges 535 files 20 documented · 1%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Moco

Build HitCount

Moco is an easy setup stub framework.

Latest Release

User Voice

Why

Integration, especially based on HTTP protocol, e.g. web service, REST etc, is wildly used in most of our development.

In the old days, we just deployed another WAR to an application server, e.g. Jetty or Tomcat etc. As we all know, it's so boring to develop a WAR and deploy it to any application server, even if we use an embeded server. And the WAR needs to be reassembled even if we just want to change a little bit.

Quick Start

  • Download Standalone Moco Runner
  • Write your own configuration file to describe your Moco server configuration as follow:
[
  {
    "response" :
      {
        "text" : "Hello, Moco"
      }
  }
]

(foo.json)

  • Run Moco HTTP server with the configuration file.
java -jar moco-runner-<version>-standalone.jar http -p 12306 -c foo.json
  • Now, open your favorite browser to visit http://localhost:12306 and you will see "Hello, Moco".

Documents

Build

Make sure you have JDK and Gradle installed.

  • Clone Moco
git clone git@github.com:dreamhead/moco.git
  • Build Moco
./gradlew build
  • Build uberjar
./gradlew uberjar
  • Check code before commit
./gradlew check

Contributing

Check out what you can help here if you do not have any existing idea.

Copyright and license

Copyright 2012-2026 ZHENG Ye

Licensed under MIT License (the "License"); You may obtain a copy of the License in the LICENSE file, or at:

https://raw.github.com/dreamhead/moco/master/MIT-LICENSE.txt

Powered By

Star History

Star History Chart

Extension points exported contracts — how you extend this code

RestSetting (Interface)
(no doc) [6 implementers]
moco-core/src/main/java/com/github/dreamhead/moco/RestSetting.java
Runner (Interface)
(no doc) [9 implementers]
moco-runner/src/main/java/com/github/dreamhead/moco/runner/Runner.java
ConfigApplier (Interface)
(no doc) [20 implementers]
moco-core/src/main/java/com/github/dreamhead/moco/ConfigApplier.java
Watcher (Interface)
(no doc) [10 implementers]
moco-runner/src/main/java/com/github/dreamhead/moco/runner/watcher/Watcher.java
Runnable (Interface)
(no doc) [10 implementers]
moco-core/src/main/java/com/github/dreamhead/moco/Runnable.java
BootstrapTask (Interface)
(no doc) [14 implementers]
moco-runner/src/main/java/com/github/dreamhead/moco/bootstrap/BootstrapTask.java
Message (Interface)
(no doc) [10 implementers]
moco-core/src/main/java/com/github/dreamhead/moco/Message.java
Container (Interface)
(no doc) [4 implementers]
moco-runner/src/main/java/com/github/dreamhead/moco/parser/model/Container.java

Core symbols most depended-on inside this repo

get
called by 573
moco-core/src/main/java/com/github/dreamhead/moco/HttpServer.java
response
called by 530
moco-core/src/main/java/com/github/dreamhead/moco/ResponseBase.java
running
called by 436
moco-core/src/main/java/com/github/dreamhead/moco/Runner.java
by
called by 353
moco-core/src/main/java/com/github/dreamhead/moco/Moco.java
request
called by 347
moco-core/src/main/java/com/github/dreamhead/moco/Server.java
uri
called by 284
moco-core/src/main/java/com/github/dreamhead/moco/Moco.java
remoteUrl
called by 223
moco-core/src/main/java/com/github/dreamhead/moco/handler/proxy/ProxyConfig.java
add
called by 172
moco-core/src/main/java/com/github/dreamhead/moco/websocket/ChannelSessionGroup.java

Shape

Method 2,671
Class 496
Interface 79
Enum 7

Languages

Java100%

Modules by API surface

moco-core/src/test/java/com/github/dreamhead/moco/MocoTest.java85 symbols
moco-core/src/main/java/com/github/dreamhead/moco/Moco.java56 symbols
moco-core/src/test/java/com/github/dreamhead/moco/MocoTemplateTest.java51 symbols
moco-core/src/test/java/com/github/dreamhead/moco/MocoRestTest.java46 symbols
moco-core/src/main/java/com/github/dreamhead/moco/util/AntPathMatcher.java45 symbols
moco-core/src/main/java/com/github/dreamhead/moco/handler/AbstractProxyResponseHandler.java39 symbols
moco-core/src/test/java/com/github/dreamhead/moco/MocoProxyTest.java34 symbols
moco-runner/src/test/java/com/github/dreamhead/moco/MocoStandaloneTest.java32 symbols
moco-core/src/test/java/com/github/dreamhead/moco/helper/MocoTestHelper.java28 symbols
moco-core/src/test/java/com/github/dreamhead/moco/MocoJsonTest.java26 symbols
moco-core/src/main/java/com/github/dreamhead/moco/resource/reader/TemplateResourceReader.java25 symbols
moco-core/src/test/java/com/github/dreamhead/moco/MocoEventTest.java24 symbols

For agents

$ claude mcp add moco \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact